Oracle字段根据逗号分割查询数据

匿名 (未验证) 提交于 2019-12-02 20:37:20

需求是表里的某个字段存储的值是以逗号分隔开来的,要求根据分隔的每一个值都能查出来数据,但是不能使用like查询。

数据是这样的:

查询的sql如下:

select * from (     select guid, regexp_substr(st_responsible, '[^,]+', 1, level) responsible          from tt_cancle_responsible          connect by level <= regexp_count(st_responsible, ',') + 1         and guid = prior guid         and prior dbms_random.value is not null ) where responsible ='wyy'; 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!