Merge Syntax
-
A. MERGE INTO <<target_table_name>> USING <<source_table_name>> WHEN MATCHED THEN UPDATE ------ WHEN NOT MATCHED THEN INSERT -------
-
B. MERGE <<target_table_name>> USING <<source_table_name>> WHEN MATCHED THEN UPDATE ------ WHEN NOT MATCHED THEN INSERT -------
-
C. MERGE INTO <<target_table_name>> USING <<source_table_name>> WHEN EXISTS THEN UPDATE ------
-
D. MERGE INTO <<target_table_name>> USING <<source_table_name>> WHEN NOT MATCHED THEN INSERT ------
-
Both A and D
MERGE syntax requires INTO keyword before the target table, followed by USING and the source table. Option A shows the correct syntax: MERGE INTO target USING source WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT. Option B is missing INTO, C uses wrong clause (EXISTS), D only has INSERT, and E is incorrect.
The standard MERGE syntax is MERGE INTO USING WHEN MATCHED THEN UPDATE ... WHEN NOT MATCHED THEN INSERT ..., combining both matched and unmatched conditions in one statement targeting a named table with INTO. Option B omits the required INTO keyword, and C invents a nonexistent WHEN EXISTS clause, which isn't valid MERGE syntax.