INSERT if UPDATE's WHERE clause returns 0
Posted: Thu Jul 28, 2005 12:19 pm
I have
If 123 doesnt exist then create (INSERT) it.
Is there a way to do this in one SQL statement in MySQL ?
Thanks
Code: Select all
UPDATE `table1` SET `field1` = 'a' WHERE `ID` = '123'Is there a way to do this in one SQL statement in MySQL ?
Thanks