outter조인을 할 수 없는 커리문이라서 문의 드립니다.
하기의 t2테이블 처럼 데이터가 나오려면 어떻게 하는게 가장 좋을까요??
WITH T1(KEY1, KEY2, KEY3 ) AS(
SELECT 'A' KEY1, 'TEST01' KEY2 , 10 AS KEY3 FROM DUAL UNION ALL
SELECT 'A', 'TEST03', 40 FROM DUAL UNION ALL
SELECT 'B', 'TEST02', 15 FROM DUAL UNION ALL
SELECT 'B', 'TEST03', 25 FROM DUAL UNION ALL
SELECT 'C', 'TEST03', 5 FROM DUAL
)
SELECT *
FROM T1;
WITH T2(KEY1, KEY2, KEY3 ) AS(
SELECT 'A' KEY1, 'TEST01', 10 AS KEY3 FROM DUAL UNION ALL
SELECT 'A', 'TEST02', 0 FROM DUAL UNION ALL
SELECT 'A', 'TEST03', 40 FROM DUAL UNION ALL
SELECT 'B', 'TEST01', 0 FROM DUAL UNION ALL
SELECT 'B', 'TEST02', 15 FROM DUAL UNION ALL
SELECT 'B', 'TEST03', 25 FROM DUAL UNION ALL
SELECT 'C', 'TEST01', 0 FROM DUAL UNION ALL
SELECT 'C', 'TEST02', 0 FROM DUAL UNION ALL
SELECT 'C', 'TEST03', 5 FROM DUAL
)
SELECT *
FROM T2
|