vendredi 28 octobre 2016

IBM dashDB sql statement for "insert row if not already existing"

I am currently working with the IBM dashDB and I need to know the sql statement for inserting a new row if this row does not already exist based to certain criteria. So, something like this:

INSERT INTO tablexyz (Col1, Col2, Col3) VALUES (val1, val2, val3) IF NOT EXIST (SELECT * FROM tablexyz WHERE val1 = x, val2 = y)

How can I do this?

Aucun commentaire:

Enregistrer un commentaire