WITH TEMP(SEQ_KEY, ITEM_NO, DETAIL_NO, DETAIL_NM) AS ( SELECT '1111', 1, 1, '전체' FROM DUAL UNION ALL SELECT '1111', 2, 1, '전체' FROM DUAL UNION ALL SELECT '1111', 3, 3, 'TM' FROM DUAL UNION ALL SELECT '1111', 3, 4, 'DM' FROM DUAL UNION ALL SELECT '1111', 3, 5, 'EM' FROM DUAL UNION ALL SELECT '1111', 3, 6, 'SMS' FROM DUAL UNION ALL SELECT '1111', 4, 1, '비고' FROM DUAL UNION ALL SELECT '2222', 1, 1, '전체' FROM DUAL UNION ALL SELECT '2222', 2, 1, '전체' FROM DUAL UNION ALL SELECT '2222', 3, 1, '제외' FROM DUAL UNION ALL SELECT '2222', 3, 3, 'TM' FROM DUAL UNION ALL SELECT '2222', 3, 5, 'EM' FROM DUAL UNION ALL SELECT '2222', 4, 1, '비고' FROM DUAL ) SELECT SEQ_KEY, ITEM_NO , ListAgg(DETAIL_NM, '|') WITHIN GROUP(ORDER BY DETAIL_NO) name_11g FROM TEMP GROUP BY SEQ_KEY, ITEM_NO ;