新博客http://www.cnblogs.com/zhjh256 欢迎访问
分类: Oracle
2008-04-18 15:03:45
将列的值转换成行
with data
as
(
select myvalues, row_number() over (order by myvalues) rn, count(*) over () cnt
from
(
select email_addr myvalues from customers where zip = 72204
)
)
select ltrim(sys_connect_by_path(myvalues, ','),',') catvalues
from data
where rn = cnt
start with rn = 1
connect by prior rn = rn-1;