Fantastic_Clouds

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

背景:配置信息存储分隔符字符串,用以业务流程中in操作符查询

示例:apple,orange,banana  -->  in ('apple', 'orange', 'banana')

用法:

select regexp_substr('apple,orange,banana','[^,]+', 1, level) from dual connect by regexp_substr('apple,orange,banana','[^,]+', 1, level) is not null

执行效果:

     REGEXP_SUBSTR('APPLE,ORANGE,BA
1    apple
2    orange
3    banana

 

posted on 2020-11-20 11:16  Fantastic_Clouds  阅读(766)  评论(0编辑  收藏  举报