MERGE Statement
Translation reference to convert Oracle MERGE statement to Snowflake Scripting
Some parts in the output code are omitted for clarity reasons.
Description
The
MERGE
statement is used to select rows from one or more sources for update or insertion into a table or view. It is possible to specify conditions to determine whether to update or insert into the target table or view. This statement is a convenient way to combine multiple operations. It lets to avoid multipleINSERT
,UPDATE
, andDELETE
DML statements.MERGE
is a deterministic statement. It is not possible to update the same row of the target table multiple times in the sameMERGE
statement. (Oracle PL/SQL Language Reference MERGE Statement))
Sample Source Patterns
Sample auxiliary data
This code was executed for a better understanding of the examples: