SQL Tutorial
SQL
Copyright IntelliPaat. All rights reserved
Agenda
Employee
1 Merge in SQL
Department
Copyright IntelliPaat. All rights reserved
Merge
MERGE is the combination of INSERT, DELETE, and UPDATE statements.
Insert Update Delete
Copyright IntelliPaat. All rights reserved
Merge
Source Table Target Table
Copyright IntelliPaat. All rights reserved
Merge
Source Table Target Table
Merge
Copyright IntelliPaat. All rights reserved
Merge
Implementing
the Merge MERGE [Target] AS T
statement! USING [Source] AS S
ON [Join Condition]
WHEN MATCHED
THEN [Update Statement]
WHEN NOT MATCHED BY TARGET
THEN [Insert Statement]
WHEN NOT MATCHED BY SOURCE
THEN [Delete Statement];
Copyright IntelliPaat. All rights reserved
Merge
Source Table Target Table
Employee_Source Employee_Target
Copyright IntelliPaat. All rights reserved
Thank You
Copyright IntelliPaat. All rights reserved