Home » SQL & PL/SQL » SQL & PL/SQL » ORA 0933: SQL command not properly ended
ORA 0933: SQL command not properly ended [message #9293] |
Fri, 31 October 2003 15:28  |
Caiàn
Messages: 2 Registered: October 2003
|
Junior Member |
|
|
Hi
I need to use this query in oracle:
SELECT C_C AS A_CER, Sum(-1*(TOT-2)*Q) AS D_CA,
Sum((TOT-1)*Q) AS E_SC,
(SELECT SUM(Q) FROM pippo.pluto
WHERE COD_LOGIN=4 AND TOT=1 AND State LIKE '-%' AND
C_C=Principale.C_C) AS MAGAZZINO
FROM pippo.pluto as Principale
WHERE TOT<>0 AND COD_LOGIN=4
GROUP BY Principale.C_C;
but it doesn't run. There is this message:
Failure: ORA 0933: SQL command not properly ended
where is my mistake?
Thanks for your help
...and excuse me for my poor english :
Caian
|
|
|
|
|
Re: ORA 0979: not a GROUP BY expression [message #9326 is a reply to message #9295] |
Tue, 04 November 2003 17:24  |
William Robertson
Messages: 1643 Registered: August 2003 Location: London, UK
|
Senior Member |
|
|
> but it dosn't work.
Sounds like it did work. The code has more than one error however.
Each item in the SELECT list must be either an aggregate expression e.g. SUM(x), AVG(x), COUNT(z), or else it must also appear in the GROUP BY list. For example,
SELECT x, y, SUM(z)
FROM some_tables
GROUP BY x, y;
is OK.
The following would give the "not a GROUP BY expression" error referring to Y, due to Y being in the SELECT list but not the GROUP BY list:
SELECT x, y, SUM(z)
FROM some_tables
GROUP BY x;
|
|
|
Goto Forum:
Current Time: Fri May 02 12:41:34 CDT 2025
|