MERGE
Grammar Syntax
For more information please refer to Redshift MERGE documentation.
Sample Source Patterns
UPDATE - INSERT
There are no differences between both languages. The code is kept in its original form.
Input Code:
Output Code:
DELETE - INSERT
There are no differences between both languages. The code is kept in its original form.
Input Code:
Output Code:
REMOVE DUPLICATES
The REMOVE DUPLICATES clause is not supported in Snowflake, however, there is a workaround that could emulate the original behavior.
The output code will have three new statements:
A TEMPORARY TABLE with the duplicate values from the source and target table that matches the condition
An INSERT statement that adds the pending values to the target table after the merge
A DROP statement that drops the generated temporary table.
These are necessary since the DROP DUPLICATES behavior removes the duplicate values from the target table and then inserts the values that match the condition from the source table.
Input Code:
Output Code:
Known Issues
There are no known issues.
Related EWIs
SSC-EWI-RS0009: Semantic information not found for the source table.
SSC-FDM-RS0005: Duplicates not allowed in source table.
Last updated