如下:
'123,456,789,101112'
要拆分成四行
123
456
789
101112
SQL如下
select substr(colname,instr(colname, ',',1,level)+1,
instr(colname,',',1,level+1)-
instr(colname,',',1,level)-1)str
from (select ','||'123,456,789,101112'||',' as colname from dual)
connect by level<length(colname)-length(replace(colname,','))
用正则表达试
SELECT REGEXP_SUBSTR('123,456,789,101112', '[^,]+', 1, LEVEL )AA FROM DUAL
CONNECT BY REGEXP_SUBSTR('123,456,789,101112', '[^,]+', 1, LEVEL ) IS NOT NULL;