listagg( ) within group ( order by ) 与 wm_concat

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
  • 2
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值