Oracle 单元格拆分成多行
程序员文章站
2024-03-04 16:54:05
...
情况:
想要达成的效果:
SQL 代码:
SELECT SECODE,REGEXP_SUBSTR(MANAGERNAME, '[^、]+',1, LEVEL, 'i') AS MANAGERNAME
FROM
(SELECT SECODE,MANAGERNAME
FROM T1 --自己的库
WHERE SECODE = '1030000005') --子查询
CONNECTED BY LEVEL <= LENGTH(MANAGERNAME) - LENGTH(REGEXP_REPLACE(MANAGERNAME,'、',''))+1