标签:com blog class div code c log t sp string ble
1
2
3
4
5
6 |
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带逗号(,)分隔的数据,码迷,mamicode.com
标签:com blog class div code c log t sp string ble
原文地址:http://www.cnblogs.com/Iyce/p/3700987.html