RE: SQL help
From: Herald ten Dam <Herald.ten.Dam_at_superconsult.nl>
Date: Tue, 24 May 2016 05:32:01 +0000
Message-ID: <9fcb958759d24770bf95127025e772ed_at_THNMS015.TheHumanNetwork.local>
Hi,
Van: oracle-l-bounce_at_freelists.org [oracle-l-bounce_at_freelists.org] namens Upendra nerilla [nupendra_at_hotmail.com] Verzonden: maandag 23 mei 2016 23:58
Aan: Oracle-L
Onderwerp: SQL help
one
first row
two
second row
Date: Tue, 24 May 2016 05:32:01 +0000
Message-ID: <9fcb958759d24770bf95127025e772ed_at_THNMS015.TheHumanNetwork.local>
Hi,
with unpivot something like this:
select output
from
(select * from test)
unpivot
(value for output in (a,b)
)
)
Herald
Van: oracle-l-bounce_at_freelists.org [oracle-l-bounce_at_freelists.org] namens Upendra nerilla [nupendra_at_hotmail.com] Verzonden: maandag 23 mei 2016 23:58
Aan: Oracle-L
Onderwerp: SQL help
Hey guys,
Could someone help with a SQL:
I have a test table with 2 rows:
create table test (a varchar2(50), b varchar2(50)); insert into test values ('one', 'first row'); insert into test values ('two', 'second row'); commit;
I need a query that shows the output as the following (without using union). Order of the values is not important.
OUTPUT
one
first row
two
second row
I thought unpivot might work, poked around a bit.. my brain is too tired to think..
Thanks in advance
-Upendra
-- http://www.freelists.org/webpage/oracle-lReceived on Tue May 24 2016 - 07:32:01 CEST