Oracle字段根据逗号分割查询数据
2018-08-06 12:56
501 查看
需求是表里的某个字段存储的值是以逗号分隔开来的,要求根据分隔的每一个值都能查出来数据,但是不能使用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字段根据逗号分割查询数据的方法
- Oracle 删除重复数据只留一条 查询及删除重复记录的SQL语句 1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断 select * from 表 wher
- Oracle 删除重复数据只留一条 查询及删除重复记录的SQL语句 1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断 select * from 表 wher
- oracle根据Date字段查询区间数据(转)
- 根据字段去重查询所有数据
- 使用SQL语句查询MySQL,SQLServer,Oracle所有数据库名和表名,字段名
- oracle查询 根据某个字段不包含某个值查询
- ORACLE 查询多行转单行数据,并且用逗号分隔展示方法
- 查询Oracle中两个字段间的数据(date类型)
- 用arcgis根据字段进行分割数据
- oracle-查询数据,其中指定字段重复的只取其中一条
- ORACLE根据字段名字查询所属表
- Oracle 查询库中所有表名、字段名、字段名说明,查询表的数据条数、表名、中文表名
- Oracle中根据时间范围查询数据
- Oracle 查询库中所有表名、字段名、字段名说明,查询表的数据条数、表名、中文表名、
- oracle中查询字段中包含单引号数据
- thinkphp 查询数据库数据根据两个字段group,且统计条数用法
- Oracle中根据时间范围查询数据
- Mysql 取字段值逗号第一个数据的查询语句