Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Consolidation of specific rows retaining another ones unaltered
Dear All,
Please have a look at this Google document.
http://docs.google.com/View?docid=ddqx8p3w_1c2szdk
I want to consolidate 3 rows (SAS-AP, SAS-AR, SAS-GL) into 1 row SAS by
summing them columnwise and retaining sum into SAS row.
One probable way is to group by using substr function on first three characters.
SELECT togroup, sum(master), sum(TRANSACTIONs), sum(reports), sum(miscallaneous)FROM (SELECT mr_issues_typewise.*, SUBSTR(MODULE, 1, 3) AS togroup FROM mr_issues_typewise)GROUP BY togroup
But this will also group INT- rows which I do not expect. Also I want to have module names in the output.
How to do this? Please help.
-Sameer Received on Mon Oct 23 2006 - 01:06:22 CDT