oracle 将逗号分隔的字符串转成多行记录

select regexp_substr('a,b,c,d', '[^,]+', 1, rownum),
       length('a,b,c,d') - length(replace('a,b,c,d', ',', '')) + 1,
       rownum,
       length(replace('a,b,c,d', ',', '')),
       length('a,b,c,d')
  from dual
connect by rownum <=
           length('a,b,c,d') - length(replace('a,b,c,d', ',', '')) + 1;
相关文章
相关标签/搜索