码迷,mamicode.com
首页 > 其他好文 > 详细

listagg( ) within group ( order by ) 与 wm_concat

时间:2014-12-22 09:22:54      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:

listagg( ) within group ( order by  )  与  wm_concat

--oracle 11g 及以后适合 最好
select spbywslid,listagg(xm,,) within group (order by spbywslid) col_name from tpg_jtcyqk group by spbywslid;



--oracle 10g 及以前版本用
select spbywslid,wm_concat(xm)xm from tpg_jtcyqk group by spbywslid;



select deptno,wm_concat(ename)name,count(*)rs from emp group by deptno

select deptno,listagg(ename,,) within group (order by ename ) aa from emp group by deptno

select deptno,listagg(ename,,) within group (order by ename ) aa,count(*)bb from emp group by deptno

 

listagg( ) within group ( order by ) 与 wm_concat

标签:

原文地址:http://www.cnblogs.com/tianmingt/p/4177460.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!