반응형
MERGE INTO 테이블명1 a
USING
(
SELECT 컬럼1, 컬럼2, 컬럼3
FROM 테이블명2
WHERE 컬럼1 >= 99999
) c
ON (a.컬럼1 = c.컬럼1)
WHEN MATCHED THEN
UPDATE SET a.컬럼2 = c.컬럼2, a.컬럼3 = c.컬럼3;
WHEN NOT MATCHED THEN
INSERT (a.컬럼1, a.컬럼2, a.컬럼3) VALUES (c.컬럼1, c.컬럼2, c.컬럼3);
반응형