Hello,
the problem is, that you use GROUP BY AND COUNT and do not specifiy what Oracle has to do with all the other fields in your SELECT statement.
f.e
SELECT grade FROM scott.salgrade GROUP BY grade (works fine)
SELECT grade, COUNT(losal) FROM scott.salgrade GROUP BY grade
(also works fine, cause grade will be grouped and in every grouped record you will get a count of losal)
SELECT grade, COUNR(losal), hisal FROM scott.salgrade GROUP BY grade
(will raise an exception - cause Oracle does not know what to do with hisal in the grouped record)
a
SELECT grade, COUNR(losal), SUM(hisal) FROM scott.salgrade GROUP BY grade
(works also fine)
So ... what you have to do is to kick out all the fields that has no group or agregate command and run the statement again.
or ...
group every field in the list
Hope this helps
Manfred Peter
(Alligator Company)
http://www.alligatorsql.com