(SELECT LIST.tm
FROM (WITH rec AS
(SELECT '1,2,3,4,5' tm
FROM DUAL)
SELECT REGEXP_SUBSTR (tm, '[^,]+', 1, LEVEL) tm
FROM rec
CONNECT BY LEVEL <= (SELECT LENGTH (REPLACE (tm, ',', NULL))
FROM rec)) LIST
WHERE LIST.tm IS NOT NULL)
Union and union all:
(SELECT LIST.tm
FROM (WITH rec AS
(SELECT '1,2,3,4,5' tm
FROM DUAL)
SELECT REGEXP_SUBSTR (tm, '[^,]+', 1, LEVEL) tm
FROM rec
CONNECT BY LEVEL <= (SELECT LENGTH (REPLACE (tm, ',', NULL))
FROM rec)) LIST
WHERE LIST.tm IS NOT NULL)
union all
(SELECT LIST.tm
FROM (WITH rec AS
(SELECT '1,2,3,4,5,6' tm
FROM DUAL)
SELECT REGEXP_SUBSTR (tm, '[^,]+', 1, LEVEL) tm
FROM rec
CONNECT BY LEVEL <= (SELECT LENGTH (REPLACE (tm, ',', NULL))
FROM rec)) LIST
WHERE LIST.tm IS NOT NULL)
No comments:
Post a Comment