Mukul Kumar
Mukul Kumar

Reputation: 724

on duplicate key update in snowflake

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

Answers (1)

Dean Flinter
Dean Flinter

Reputation: 674

What you are looking for is the MERGE command

https://docs.snowflake.com/en/sql-reference/sql/merge.html

Upvotes: 1

Related Questions