select * from (
with a as(
select 1 id,'2,3,4,5,6' auth from dual
)
SELECT id,decode(B,0,substr(auth,C),substr(auth,C,B-C)) auth FROM
(
SELECT id,auth,B,(lag(B,1,0) over(order by LV))+1 C
FROM(
SELECT id,auth,instr(auth,',',1,level) B,level LV from A
CONNECT BY level <=(length(auth) - length(replace(auth,',','')))+1
)
)
)
|