Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL needs modification
Joe wrote:
> Hi,
> Is there a way I can alter my query to flatten out my report to look
> like this?:
>
> MONTH 1998 1999 2000
> ------ ---- ---- ----
> JAN 17 2 2
>
from
>
> MONTH 1998 1999 2000 USAGE
> ------ ---- ---- ----- ------
> JAN 1 0 0 17
> JAN 0 1 0 2
> JAN 0 0 1 2
>
> ************************
SELECT month, SUM(x), SUM(y), SUM(z)
FROM (
<your SQL statement here>)
GROUP BY month;
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Mon Feb 23 2004 - 17:49:38 CST