這是我嘗試運行查詢:錯誤在查詢中使用WHERE IN
Select Status from [transaction] where TransactionID IN (select MAX(CAST(TransactionID AS VARCHAR(36))), sum(debit)
FROM [transaction]
WHERE dbo.getday(StartSaleTime) >= '5/1/2011' and dbo.getday(StartSaleTime) <= '5/3/2011' and Status > -1 And TransactionNo like 'EL%' And TransactionType = 4
GROUP BY CustomerID, debit HAVING (COUNT(CustomerID) > 1))
它返回此錯誤:
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.