Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: merging rows
> Hi All,
>
> What is the best way to merge some rows. Lets say I have three rows in
> a table and I want to replace them three with one row.
>
> Columns: A, B , C, D , E
>
> If Columns A, B and C are equal for rows then I want to merge those
> rows into one. I would use SUM on D and AVG on E.
I am not entierly sure if I understand what you mean. But I think
you want something like
http://www.adp-gmbh.ch/ora/sql/user_def_agg.html (9i) or
http://www.adp-gmbh.ch/blog/2005/march/28.html (10g).
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Wed Apr 20 2005 - 02:25:32 CDT