Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL BrainTeaser
Krisss <kmbotha_at_netinfo.ubc.ca> wrote:
Hi,
> What I'd like to do is combine rows that have the same id2 (by summing
> their value). i.e. I want to get is THIS table:
> id2 value
> ------------------------------
> a1 10
> a2 3
> a3 8
> a4 20
> any ideas on how I should go about this using SQL??
yes, it's rather simple.
SELECT id2, SUM(value) FROM table GROUP BY id2;
Bye,
Wolf
Received on Thu Jun 21 2001 - 05:05:06 CDT