1.用逗号拼接的字符串内容如何拆分成多行
select regexp_substr('abc,def,gkk', '[^,]+', 1, level),level
from dual
connect by level <= regexp_count('abc,def,gkk', ',')+1
2.将多列的数据合并成一个字段
select deptno,listagg(ename,',')within group(order by ename)name from emp group by deptno;
注:listagg 可以和单行分组函数min,max 一起使用
可以和group by 使用,在组内进行拼接