Last active
August 2, 2016 09:18
-
-
Save robinraju/ec674d081a04c3d0a73b6602b74f41c3 to your computer and use it in GitHub Desktop.
MySQL Upsert | Update row if exists, otherwise perform Insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO <TABLE> | |
(<COLUMN 1>, <COLUMN 2>) | |
VALUES( <VALUE 1>,<VALUE 2>) | |
ON DUPLICATE KEY UPDATE | |
`<COLUMN1>` = '<VALUE1>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment