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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL

Re: SQL

From: spencer <spencerp_at_swbell.net>
Date: 2000/04/12
Message-ID: <yebJ4.9147$lT3.215517@news.swbell.net>#1/1

try something like this:

select task_code
 , sum(decode(resource_type,'L',qty,0)) L  , sum(decode(resource_type,'P',qty,0)) P from recordings
group by task_code

<kskasi_at_hotmail.com> wrote in message
news:38F50A09.9D99184A_at_hotmail.com...
> Hi everyone
>
> I have an SQL which looks like the following
>
> Select resource_type, task_code, sum(qty)
> from recordings
> group by resource_type, task_code;
>
> The result set looks like the following
> L 20010 1
> L 30010 2
> L 40010 3
> P 20010 4
> P 30010 5
> P 40010 6
>
> I want the output to be displayed in the following format
> L P
> 20010 1 4
> 30010 2 5
> 40010 3 6
>
> Is it possible to so. I need to do that inside a cursor
>
> regards...kasi
>
>
>
Received on Wed Apr 12 2000 - 00:00:00 CDT

Original text of this message

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