Newbie SQL Question

From: Vic Smyth <vicsmyth_at_megsinet.net>
Date: Mon, 29 Mar 1999 15:42:54 -0800
Message-ID: <37000FFE.1084_at_megsinet.net>



I'm doing a project for school using sqlplus (command-line sql for Oracle). I keep getting the following error message when I try to do a GROUP BY. Other commands I have no problem with. If I take out CUSTOMER.CUS_BALANCE on line 1 the command executes and I get everything except the column I deleted. My text and the help screen in Oracle are not much help. What am I doing wrong?

Thanks in advance!

Vic

To reply to email remove the "myth" from the address.

SQL> SELECT CUSTOMER.CUS_CODE, CUSTOMER.CUS_BALANCE,   2 SUM(LINE.LINE_UNITS * LINE.LINE_PRICE)   3 FROM CUSTOMER, INVOICE, LINE
  4 WHERE CUSTOMER.CUS_CODE = INVOICE.CUS_CODE   5 AND LINE.INV_NUMBER = INVOICE.INV_NUMBER
  6 GROUP BY CUSTOMER.CUS_CODE;
SELECT CUSTOMER.CUS_CODE, CUSTOMER.CUS_BALANCE,

                          *

ERROR at line 1:
ORA-00979: not a GROUP BY expression Received on Tue Mar 30 1999 - 01:42:54 CEST

Original text of this message