RE: SQL help

From: Upendra nerilla <nupendra_at_hotmail.com>
Date: Tue, 24 May 2016 01:56:33 -0400
Message-ID: <BLU181-W7671774E763D9C2941CB76D84F0_at_phx.gbl>



Awesome. That did it. Thank you so much.

I used "value" instead of "output":
select value
 from
 (select * from test)
 unpivot
 (value for output in (a,b)
 )
/

> From: Herald.ten.Dam_at_superconsult.nl
> To: nupendra_at_hotmail.com; oracle-l_at_freelists.org
> Subject: RE: SQL help
> 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_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-l
>
>
                                               

--
http://www.freelists.org/webpage/oracle-l
Received on Tue May 24 2016 - 07:56:33 CEST

Original text of this message