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;
相關文章
相關標籤/搜索