SELECT *
FROM (WITH temptest AS (SELECT LEVEL lv FROM DUAL connect BY LEVEL <= 10)
select lv,
cnt,
gdm,
substr(vals,
instr(t.vals,',1,ts.lv) + 1,ts.lv + 1) -
(instr(t.vals,ts.lv) + 1)) AS name
from (SELECT g.gdm,
',' || g.gdgr || ',' as vals,
(LENGTH(',' || g.gdgr) - LENGTH(REPLACE(gdgr,'))) as cnt
FROM MYTEST.GD g) t
join temptest ts on ts.lv <= t.cnt
where gdm = '腾讯'
)
原数据
主要是为了将以逗号存的数据以行的形式展现出来
原文链接:/oracle/208497.html