【发布时间】:2020-08-30 01:59:51
【问题描述】:
我已经看到了如何将逗号分隔的字符串分隔为如下行的示例:
select distinct id, trim(regexp_substr(value,'[^,]+', 1, level) ) value, level
from tbl1
connect by regexp_substr(value, '[^,]+', 1, level) is not null
order by id, level;
但是,我的问题是,如何对双引号和逗号分隔的字符串执行此操作?
例如:以上适用于“1,2,3,4,5,6,7”之类的字符串,但是“1”、“2”、“3”、“4,5”、“6”呢? ,7,8","9" 使行最终如下:
1
2
3
4,5
6,7,8
9
编辑:我使用的是 Oracle 11.2.0.4、11gR2。
【问题讨论】: