需求是表里的某個字段存儲的值是以逗號分隔開來的,要求根據(jù)分隔的每一個值都能查出來數(shù)據(jù),但是不能使用like查詢。
數(shù)據(jù)是這樣的:
查詢的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‘;
查詢結(jié)果如下:
總結(jié)
以上所述是小編給大家介紹的Oracle字段根據(jù)逗號分割查詢數(shù)據(jù)的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!