Reputation: 724
How can I use insert
statement with on duplicate key update
like MySQL in Snowflake?
MySQL code :
INSERT INTO table (column_list)
VALUES (value_list)
ON DUPLICATE KEY UPDATE
c1 = v1,
c2 = v2,
...;
Since snowflake does not support ON DUPLICATE KEY UPDATE
, how can I implement the same in snowflake?
Upvotes: 2
Views: 1970
Reputation: 674
What you are looking for is the MERGE command
https://docs.snowflake.com/en/sql-reference/sql/merge.html
Upvotes: 1