多行合并一行
listagg(字段, '分隔符') within group(order by 字段)
listagg(chour, ',') within group(order by chour)
wmsys.wm_concat实现同样效果,默认逗号
select nation,wmsys.wm_concat(city)
listagg详细使用
listagg (T .ENAME, ',') WITHIN GROUP (ORDER BY T .ENAME) over(PARTITION BY T .DEPTNO)
加了over(PARTITION BY T .DEPTNO)后行数不会减少