列转行

时间:2014-10-18 17:01:06   收藏:0   阅读:273

test:

c1   c2

1    a

1     b

2     c

 

select
            to_char(wmsys.wm_concat(c2))                                   ,
            to_char(replace(wmsys.wm_concat(c2),‘,‘,‘/‘))

     from
            test   

  group by
             c1

show case:

1     a,b   a/b

2      c       c

同样的功能函数:

 select listagg(c2,‘,‘) within group(order by c1)        from test      ;  

原文:http://blog.csdn.net/jenya007/article/details/40211991

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!