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

 

原文:https://www.cnblogs.com/gdzhong/p/4726315.html

posted @ 2021-02-22 19:44  Jackie Hao  阅读(704)  评论(0编辑  收藏  举报