Oracle行转列实例(转载)
行转列之前的数据:
select * from tbname;
行转列之后的数据:
select pud, listagg(ud, ',') within group(order by null) as ud
from tbname
group by pud;
其中,
listagg(ud, ',') within group(order by null)
为行转列函数,ud为需要转化的列
as ud
as ud 为给转后的列匿名一个新列名。
完成。
----------------------------------------------------
转载地址:
https://www.cnblogs.com/liudi1992/p/6039343.html
-----------------------------------------------------
Oracle行转列实例
猜你喜欢
转载自zhongdao.iteye.com/blog/2404769
今日推荐
周排行