在 oracle 中编译代码时出错,错误是 ORA-00979: not a GROUP BY expression,我想知道如何解决这个问题,因为如果我使用 GROUP BY 和 SUM 函数 ORDER BY 不适合我.
SELECT
INVOICE.CUS_CODE,
CUSTOMER.CUS_BALANCE,
SUM(LINE.LINE_UNITS * LINE.LINE_PRICE )AS "TOTAL PURCHASES"
FROM
INVOICE, CUSTOMER, LINE
WHERE
CUSTOMER.CUS_CODE = INVOICE.CUS_CODE AND INVOICE.INV_NUMBER= LINE.INV_NUMBER
GROUP BY
INVOICE.CUS_CODE