2

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?

Mukul Kumar
  • 564
  • 1
  • 5
  • 24

1 Answers1

0

What you are looking for is the MERGE command

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

Dean Flinter
  • 654
  • 3
  • 6