看別人帖子自己仿照寫了乙個
c1 c2 c3
01 01 a,b,c
轉化為c0 c1 c2 c3
a 01 01 a,b,c
b 01 01 a,b,c
c 01 01 a,b,c
select substr(routeidlist,
instr(',' || routeidlist || ',', ',', 1, t2.row_num),
instr(',' || routeidlist || ',', ',', 1, t2.row_num + 1) - 1 -
instr(',' || routeidlist, ',', 1, t2.row_num)) as sbid,
t1.*
from table t1,
(select rownum as row_num
from user_objects
where rownum <= (select length(routeidlist) -
length(replace(routeidlist, ',', '')) + 1
from table
where tableid= '1000000020')) t2
where t1.tableid= '1000000020'
Oracle欄位根據逗號分割查詢資料
需求是表裡的某個字段儲存的值是以逗號分隔開來的,要求根據分隔的每乙個值都能查出來資料,但是不能使用like查詢。資料是這樣的 查詢的sql如下 select from select guid,regexp substr st responsible,1,level responsible from ...
Oracle欄位根據逗號分割查詢資料的方法
需求是表裡的某個字段儲存的值是以逗號分隔開來的,要求根據分隔的每乙個值都能查出來資料,但是不能使用like查詢。資料是這樣的 查詢的sql如下 select from 程式設計客棧 select guid,regexp substr st responsible,1,level rwww.cppcn...
oralce逗號分割變多行
方法一select a.regexp substr a.rolecode 1,l as rolecode from p user a,select level l from dual connect by level 100 b where l length a.rolecode length re...