Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [student] How to correct this error?
You get this error when you fail to group by the values retrieved that you
wish to aggregate over. In short this means add a GROUP BY clause at the
bottom of your SQL and include in the list all retrieved items in your
SELECT list which you are not aggregated in your query.
TO explain, lets consider the SQL
SELECT deptno, SUM(salary)
FROM WhatevereTable
What we want to do is display each deptno along with the sum of salary values for the particular deptno. WE need to tell Oracle that we wish to aggregate salary within individual values for deptno and the way we do this is by the GROUP BY clause. The above will gove an error but
SELECT deptno, SUM(salary)
FROM WhatevereTable
GROUP BY deptno
will not.
--
Alan D. Mills
Oliver White wrote in message <36347579.31827668_at_news.m.iinet.net.au>...
>
>ORA-00937: not a single-group group function
>
>I'm not entirely sure what this means, here is my script for
>diagnosis:
>
.
>MHM 22x9
>--
>
Received on Mon Oct 26 1998 - 08:47:21 CST