需求是表里的某個字段存儲的值是以逗號分隔開來的,要求根據分隔的每一個值都能查出來數據,但是不能使用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';
查詢結果如下: