Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Question about query with SUM
select id , sum(usage)
from usage
group by id;
-- Regards Sergey Gerasimov gsa_at_baltros.ru "Rolf Kamp" <rfk_at_exit109.com> ???????/???????? ? ???????? ?????????: news:3A4936C1.35597C57_at_exit109.com...Received on Wed Dec 27 2000 - 01:06:44 CST
> Hi:
> I have a table with 2 rows:
> - ID (a varchar)
> - usage (a number)
>
> Presently, I have a query that returns the distinct IDs in the
> table, then I query the table and SUM(usage) for each unique ID. I would
> like to have oracle do both steps for me in 1 query. So far I have this:
>
> select distinct ID, SUM(USAGE)
> from USAGE;
>
> But I get an error stating "Not a single group function".
>
> Any help is greatly appreciated.
> - rfk
>
![]() |
![]() |