Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL
cursor c is
select --+ all_rows
r.resource_type , r.sum_qty , s.sum_qty from ( select resource_type , sum (qty) as sum_qty from recordings where 1 = 1 and task_code = 'L' group by resource_type ) r, ( select resource_type , sum (qty) as sum_qty from recordings where 1 = 1 and task_code = 'P' group by resource_type ) s
kskasi_at_hotmail.com wrote:
>
> 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 Thu Apr 13 2000 - 00:00:00 CDT