WITH data_t AS ( SELECT 1 pk, '1,2,4' code FROM dual UNION ALL SELECT 2, '2' FROM dual UNION ALL SELECT 3, '1,3,4' FROM dual ) , code_t AS ( SELECT '1' code, '학생' name FROM dual UNION ALL SELECT '2', '담임' FROM dual UNION ALL SELECT '3', '교직원' FROM dual UNION ALL SELECT '4', '비회원' FROM dual ) SELECT a.pk , a.code , LISTAGG(b.name, ',') WITHIN GROUP( ORDER BY INSTR(','||a.code||',', ','||b.code||',')) name FROM data_t a , code_t b WHERE INSTR(','||a.code||',', ','||b.code||',') > 0 GROUP BY a.pk, a.code ;