아래처럼 변형해서 처리하시려는 걸까요..?
SELECT REGEXP_SUBSTR('code1|code2|code3', '[^|]+', 1, level) AS parts FROM dual CONNECT BY REGEXP_SUBSTR('code1|code2|code3', '[^|]+', 1, level) IS NOT NULL; SELECT REGEXP_SUBSTR('코드한글명1,코드한글명2,코드한글명3' , '[^,]+', 1, level) AS parts FROM dual CONNECT BY REGEXP_SUBSTR('코드한글명1,코드한글명2,코드한글명3' , '[^,]+', 1, level) IS NOT NULL;
WITH t_code AS ( SELECT 'CODE1' cd, '코드한글명1' nm FROM dual UNION ALL SELECT 'CODE2', '코드한글명2' FROM dual UNION ALL SELECT 'CODE3', '코드한글명3' FROM dual ) , t_data AS ( SELECT 1 pk, 'CODE1|CODE2|CODE3' cd FROM dual UNION ALL SELECT 2, 'CODE1|CODE3' FROM dual UNION ALL SELECT 3, 'CODE3|CODE1' FROM dual ) SELECT a.pk , a.cd , LISTAGG(b.nm, ',') WITHIN GROUP(ORDER BY INSTR('|'||a.cd||'|', '|'||b.cd||'|')) nm FROM t_data a , t_code b WHERE INSTR('|'||a.cd||'|', '|'||b.cd||'|') > 0 GROUP BY a.pk, a.cd ;