Vijay Vijay - 16 days ago 49
SQL Question

Convert row data to column data in oracle sql

For example: There is a table of one column is having data like

common
and I want to display it as

c
o
m
m
o
n

APC APC
Answer Source

For the posted sample data this'll do ya:

select substr(col1, level, 1)
from t23
connect by level <= length(col1)
/

If your real need is more complicated then you must post a realistic use case. If you simply have more than one row of data in your table then MT0's recursive WITH clause solution is the way to go (assuming you are on 11gR2 or higher)