需求是表里的某個字段存儲的值是以逗號分隔開來的,要求根據分隔的每一個值都能查出來數據,但是不能使用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‘;
查詢結果如下:
總結
以上所述是小編給大家介紹的Oracle字段根據逗號分割查詢數據的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VeVb武林網網站的支持!
新聞熱點
疑難解答