巧用:regexp_substr 对知道数据进行分割
---Demo
select *
from org_organization_definitions org
where org.ORGANIZATION_CODE in
(select regexp_substr(replace(字符参数, ',', ','),
'[^,]+',
1,
rownum) buyers
from dual
connect by rownum <=
length(replace(字符参数, ',', ',')) -
length(replace(replace(字符参数, ',', ','),
',',
'')) + 1)
------示例
select regexp_substr(replace('101,102,702,703', ',', ','),
'[^,]+',
1,
rownum) buyers
from dual
connect by rownum <=
length(replace('101,102,702,703', ',', ',')) -
length(replace(replace('101,102,702,703', ',', ','), ',', '')) + 1
---结果

本文来自博客园,作者:Iven_lin,转载请注明原文链接:https://www.cnblogs.com/ivenlin/p/18223698
浙公网安备 33010602011771号