Transpose [message #569740] |
Wed, 31 October 2012 19:16  |
 |
primer2020
Messages: 32 Registered: August 2012
|
Member |
|
|
Hello,
I have this select statement that out puts exactly one row and three columns.
select 'One' as A, 'Two' as B, 'Three' as C from dual
A B C
---- ---- ----
One Two Three
I would like to have this output:
One
Two
Three
One possible solution is:
select 'One' as A from dual
union all
select 'Two' as B from dual
union all
select 'Three' as C from dual
I would like to have a different solution/concept.
Thank you
|
|
|
|
|
Re: Transpose [message #569781 is a reply to message #569748] |
Thu, 01 November 2012 08:33   |
_jum
Messages: 577 Registered: February 2008
|
Senior Member |
|
|
In this special case you could use:
SELECT level,
TO_CHAR(TO_DATE(level,'J'),'Jsp') words
FROM dual CONNECT BY level<=3;
level words
---------------
1 One
2 Two
3 Three
For explanation have a look at Format Models esp. J and SP
|
|
|
|
Re: Transpose [message #569791 is a reply to message #569788] |
Thu, 01 November 2012 11:26  |
 |
Michel Cadot
Messages: 68765 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
So you didn't read the links I posted. Lazy boy...
Don't count on me to help you in your futur questions as I and anyone but _jum do not deserve your thanks (see your previous topics).
You will have to wait for _jum to get help now.
Regards
Michel
|
|
|