若符合條件則 update,
否則 insert
MERGE INTO Table1 target
USING Table2 source
ON (target.COLUMN1 = source.COLUMN1)
WHEN MATCHED THEN UPDATE SET taeged.COLUMN2 = source.COLUMN2
WHEN NOT MATCHED THEN
INSERT /** (target.COLUMN1, target.COLUMN2, target.COLUMN3) **/
VALUES (source.COLUMN1, source.COLUMN2, source.COLUMN3)
;
沒有留言:
張貼留言