SELECT X.RES_NO, (NM_1||'|'||NM_2||'|'||NM_3||'|'||NM_4||'|'||NM_5||'|'||NM_6||'|'||NM_7||'|'||NM_8||'|'||NM_9||'|'||NM_10) AS ALL_NM
FROM (
SELECT RES_NO
, MAX(CASE SEQ WHEN 1 THEN B.DELI_KR_NM END) NM_1
, MAX(CASE SEQ WHEN 2 THEN B.DELI_KR_NM END) NM_2
, MAX(CASE SEQ WHEN 3 THEN B.DELI_KR_NM END) NM_3
, MAX(CASE SEQ WHEN 4 THEN B.DELI_KR_NM END) NM_4
, MAX(CASE SEQ WHEN 5 THEN B.DELI_KR_NM END) NM_5
, MAX(CASE SEQ WHEN 6 THEN B.DELI_KR_NM END) NM_6
, MAX(CASE SEQ WHEN 7 THEN B.DELI_KR_NM END) NM_7
, MAX(CASE SEQ WHEN 8 THEN B.DELI_KR_NM END) NM_8
, MAX(CASE SEQ WHEN 9 THEN B.DELI_KR_NM END) NM_9
, MAX(CASE SEQ WHEN 10 THEN B.DELI_KR_NM END) NM_10
FROM 테이블 A, 테이블 B
WHERE A.칼럼 = B.칼럼
GROUP BY RES_NO
) X
FROM (
SELECT RES_NO
, MAX(CASE SEQ WHEN 1 THEN B.DELI_KR_NM END) NM_1
, MAX(CASE SEQ WHEN 2 THEN B.DELI_KR_NM END) NM_2
, MAX(CASE SEQ WHEN 3 THEN B.DELI_KR_NM END) NM_3
, MAX(CASE SEQ WHEN 4 THEN B.DELI_KR_NM END) NM_4
, MAX(CASE SEQ WHEN 5 THEN B.DELI_KR_NM END) NM_5
, MAX(CASE SEQ WHEN 6 THEN B.DELI_KR_NM END) NM_6
, MAX(CASE SEQ WHEN 7 THEN B.DELI_KR_NM END) NM_7
, MAX(CASE SEQ WHEN 8 THEN B.DELI_KR_NM END) NM_8
, MAX(CASE SEQ WHEN 9 THEN B.DELI_KR_NM END) NM_9
, MAX(CASE SEQ WHEN 10 THEN B.DELI_KR_NM END) NM_10
FROM 테이블 A, 테이블 B
WHERE A.칼럼 = B.칼럼
GROUP BY RES_NO
) X