Columns values into rows [message #609231] |
Tue, 04 March 2014 04:31 |
|
msinha8
Messages: 43 Registered: March 2014 Location: Hyderbad
|
Member |
|
|
Hello All,
I got some of values in the one column as a string
and I would like to get every of this values into the row.
For instance:
COLUMN
ABC
And result should be:
COLUMN
A
B
C
Does anybody help me on this ?
Thanks a lot
Regards
|
|
|
|
|
|
Re: Columns values into rows [message #609239 is a reply to message #609235] |
Tue, 04 March 2014 05:52 |
|
Michel Cadot
Messages: 68641 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
SQL> with t as (
2 select 'ABC' val from dual
3 union all
4 select 'Michel' from dual
5 )
6 select val, substr(val, column_value, 1) letter
7 from t,
8 TABLE(CAST(MULTISET(SELECT LEVEL FROM DUAL CONNECT BY LEVEL <= LENGTH(val))
9 AS SYS.odcivarchar2list))
10 order by val, column_value
11 /
VAL L
------ -
ABC A
ABC B
ABC C
Michel M
Michel i
Michel c
Michel h
Michel e
Michel l
|
|
|