循环查询sql带逗号(,)分隔的数据
时间:2022-03-10 16:58
select
* from
sys_role_list where
id in ( select
c from (with test as
( select
roleid c from
sys_role_info where
id=1) select
substr(t.ca,instr(t.ca, ‘,‘ , 1, c.lv) + 1,instr(t.ca, ‘,‘ , 1, c.lv + 1) - (instr(t.ca, ‘,‘ , 1, c.lv) + 1)) AS c from
( select
‘,‘ || c || ‘,‘
AS ca,length(c || ‘,‘ ) - nvl(length(REPLACE(c, ‘,‘ )), 0) AS cnt FROM test) t, ( select
LEVEL lv from
dual CONNECT BY LEVEL <= 100) c where
c.lv <= t.cnt )) |
循环查询sql带逗号(,)分隔的数据,gxlsystem