SELECT DISTINCT token FROM (
SELECT TRIM (SUBSTR (txt,
INSTR (txt, ',', 1, LEVEL) + 1,
INSTR (txt, ',', 1, LEVEL + 1)
- INSTR (txt, ',', 1, LEVEL)
- 1
)
) AS token
FROM (SELECT ',' || '111,333,333,444,' || ',' txt
FROM DUAL)
CONNECT BY LEVEL <=
LENGTH ('111,333,333,444')
- LENGTH (REPLACE ('111,333,333,444', ',', ''))
+ 1)
SELECT TRIM (SUBSTR (txt,
INSTR (txt, ',', 1, LEVEL) + 1,
INSTR (txt, ',', 1, LEVEL + 1)
- INSTR (txt, ',', 1, LEVEL)
- 1
)
) AS token
FROM (SELECT ',' || '111,333,333,444,' || ',' txt
FROM DUAL)
CONNECT BY LEVEL <=
LENGTH ('111,333,333,444')
- LENGTH (REPLACE ('111,333,333,444', ',', ''))
+ 1)