0
如何僅在擴展價格不等於小計時才顯示invoicenumber?
下面的查詢是無法運行和錯誤組功能在這裏不允許使用
SELECT a.INVOICENUMBER,SUM(a.EXTENDEDPRICE),SUM(a.SUBTOTAL)
FROM CUSTOMERORDERHISTORYVIEW a
WHERE EXISTS
(SELECT a1.INVOICENUMBER FROM CUSTOMERORDERHISTORYVIEW a1 WHERE
a.INVOICENUMBER=a1.INVOICENUMBER AND SUM(a1.EXTENDEDPRICE) <> SUM(a1.SUBTOTAL))
GROUP BY a.INVOICENUMBER;