WITH t AS ( SELECT '월,수' gb, 'C01,C02,C03' cd FROM dual UNION ALL SELECT '화' , 'C01,M01' FROM dual UNION ALL SELECT '목,금', 'C02,M03' FROM dual ) SELECT REGEXP_SUBSTR(a.gb, '[^,]+', 1, b.lv) gb , REGEXP_SUBSTR(a.cd, '[^,]+', 1, c.lv) cd FROM t a , (SELECT LEVEL lv FROM dual CONNECT BY LEVEL <= 5) b , (SELECT LEVEL lv FROM dual CONNECT BY LEVEL <= 5) c WHERE b.lv <= REGEXP_COUNT(a.gb, '[^,]+') AND c.lv <= REGEXP_COUNT(a.cd, '[^,]+') ORDER BY INSTR('월화수목금', gb), cd ;