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: merge columns as rows in a result

Re: merge columns as rows in a result

From: Brian E Dick <bdick_at_cox.net>
Date: Tue, 19 Nov 2002 18:38:22 GMT
Message-ID: <yyvC9.18584$0U1.1962378@news2.east.cox.net>


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

Original text of this message

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