Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL needs modification

Re: SQL needs modification

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 23 Feb 2004 15:49:38 -0800
Message-ID: <1077580138.110102@yasure>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US