WITH TBL_T1 AS
(
SELECT '1' AS VAL, 'AA' AS GUBUN FROM DUAL
UNION ALL
SELECT '2', 'BB' FROM DUAL
UNION ALL
SELECT '3', 'CC' FROM DUAL
UNION ALL
SELECT '4', 'DD' FROM DUAL
),
TBL_T2 AS
(
SELECT *
FROM
(
SELECT '1' AS AA, '2' AS BB, '3' AS CC, '4' AS DD
FROM DUAL
)
UNPIVOT (VAL FOR GUBUN IN(AA, BB, CC, DD ))
)
SELECT * FROM TBL_T2
LEFT JOIN TBL_T1
ON TBL_T2.GUBUN = TBL_T1.GUBUN;
이렇게 해 보니 UNPIVOT (VAL FOR GUBUN IN(AA, BB, CC, DD )) <-- 해당 구문 중 마지막 DD만 조인이 걸리고
다른 값들은 걸리지 않아서요. 궁금합니다. 미리 감사드립니다.