我有字符串「ABC」我需要分成數行如下的Oracle SQL分割字符串行
A
B
C
。我知道怎麼做的時候分隔符是存在的。如何當分隔符不存在
with test as
(select 'A,B,C' col1 from dual)
select regexp_substr(col1, '[^,]+', 1, rownum) result1
from test
connect by level <= length(regexp_replace(col1, '[^,]+')) + 1;
它是否總是3個字符在每個之後用逗號分隔? – sagi
沒有。它是可變的。 –