RE: SQL help

  • From: Herald ten Dam <Herald.ten.Dam@xxxxxxxxxxxxxxx>
  • To: "nupendra@xxxxxxxxxxx" <nupendra@xxxxxxxxxxx>, Oracle-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 24 May 2016 05:32:01 +0000

Hi,

with unpivot something like this:
select output
from 
(select * from test)
unpivot
(value for output in (a,b)
)
)

Herald

________________________________________
Van: oracle-l-bounce@xxxxxxxxxxxxx [oracle-l-bounce@xxxxxxxxxxxxx] namens 
Upendra nerilla [nupendra@xxxxxxxxxxx]
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
--
//www.freelists.org/webpage/oracle-l


  • References:

Other related posts: