mercredi 16 juin 2021

Translate IF-ELSE statement of MS SQL to SnowFlake

I have a MS SQL query like this:

IF EXISTS(SELECT * FROM TableDescription WHERE "viewname"='abc')
UPDATE TableDescription 
SET "viewname"='abc' , "description"='description xyz' 
WHERE "viewname"='abc'
ELSE
INSERT INTO TableDescription ("viewname","description") VALUES('abc','description xyz')

And I would like to translate the above MS SQL query to a coresponding query that works on SnowFlake but not sure how I can do it :( Could someone please give me a hint? Thanks so much Hanh

Aucun commentaire:

Enregistrer un commentaire