Oracle分割字符串为多行
select REGEXP_SUBSTR(a.rolecode ,'[^,]+',1,l) rolecode from ( select 'a,aa,aaa' rolecode from dual ) a, (SELECT LEVEL l FROM DUAL CONNECT BY LEVEL<=100) b WHERE l <=LENGTH(a.rolecode) - LENGTH(REPLACE(rolecode,','))+1
select REGEXP_SUBSTR(a.rolecode ,'[^,]+',1,l) rolecode from ( select 'a,aa,aaa' rolecode from dual ) a, (SELECT LEVEL l FROM DUAL CONNECT BY LEVEL<=100) b WHERE l <=LENGTH(a.rolecode) - LENGTH(REPLACE(rolecode,','))+1