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

来源:互联网 发布:淘宝乐高军事玩具大全 编辑:程序博客网 时间:2024/06/06 07:09

原文:

https://blogs.oracle.com/aramamoo/entry/how_to_split_comma_separated_string_and_pass_to_in_clause_of_select_statement

 

select regexp_substr('SMITH,ALLEN,WARD,JONES','[^,]+', 1, level) from dual
connect by regexp_substr('SMITH,ALLEN,WARD,JONES', '[^,]+', 1, level) is not null

1 0
原创粉丝点击