
Explanation:
The correct answer is MERGE.
WHEN MATCHED THEN UPDATE and WHEN NOT MATCHED THEN INSERTignoreDuplicates in some APIs, it's not a SQL commandMERGE INTO target_table AS target
USING source_table AS source
ON target.id = source.id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *;
MERGE INTO target_table AS target
USING source_table AS source
ON target.id = source.id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *;
This pattern ensures that existing records are updated and new records are inserted, preventing duplicates based on the matching condition.
Ultimate access to all questions.
No comments yet.