当前位置: 移动技术网 > IT编程>数据库>Oracle > Oracle字段根据逗号分割查询数据的方法

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

2019年05月28日  | 移动技术网IT编程  | 我要评论

div css实例教程,中华美食菜谱,爱我就别伤害我伴奏

需求是表里的某个字段存储的值是以逗号分隔开来的,要求根据分隔的每一个值都能查出来数据,但是不能使用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字段根据逗号分割查询数据的方法,希望对大家有所帮助

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网