Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: merge columns as rows in a result
select c1, c2
from t
union all
select c3, -c2
from t
"Ritesh G." <garodiar_at_yahoo.com> wrote in message
news:1ada02e0.0211191007.4931724a_at_posting.google.com...
> hi,
>
> I have a table like
>
> FROM QTY TO
> ===============
> L1 2 L2
> L2 4 L3
> L1 5 L4
>
> Now i want to conver this into
>
> L1 2
> L2 -2
> L2 4
> L3 -4
> L1 5
> L4 -5
>
> Can do this somehow with only a single SQL and no PL/SQL.
>
> Thanks
> Ritesh
Received on Tue Nov 19 2002 - 12:38:22 CST