hexu
1/4/2019 - 7:40 AM

Oracle把逗号分割的字符串转换为可放入in的条件语句的字符数列

Oracle把逗号分割的字符串转换为可放入in的条件语句的字符数列

select DESCRIPTION from ADDNOTES_LINE_TABLE where LINE_NO IN (

SELECT REGEXP_SUBSTR('0050300046095,0050600249032','[^,]+', 1, LEVEL) FROM DUAL

CONNECT BY REGEXP_SUBSTR('SMITH,ALLEN,WARD,JONES', '[^,]+', 1, LEVEL) IS NOT NULL

)