GROUP BY Clause -SQL Devolper error 00904. 00000 - "%s: invalid identifier
878880Jul 28 2011 — edited Jul 29 2011I'm a real novice with SQL and I am having a problem understanding why this doesn't work. Searching the web got me to this forum, but I haven't been able to find a solution. Obviuosly I don't really understand how to use the GROUP BY clause. The SQL works fine without that clause.
As stated in the subject I am getting this error:
ORA-00904: "SORTPLAN": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 9 Column: 17
With this SQL statement:
SELECT START_DTM,
END_DTM,
MACHINE_SORT_PROGRAM_NAME as Sortplan,
sum(TOTAL_PIECES_FED_CNT) AS TotalFed
FROM END_OF_RUN
WHERE MODS_DATE BETWEEN '27-Jul-2011' AND '27-Jul-2011'
AND MAIL_OPERATION_NBR =919
AND SITE_ID = 81003
GROUP BY Sortplan
ORDER BY Sortplan;
TIA
Mike