Last active
August 29, 2015 13:56
-
-
Save ddbs/9239403 to your computer and use it in GitHub Desktop.
sql: insert on duplicate key update (update only specific columns if a unique key already exists; insert new rows if unique key does not exist)
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 _customers (`User ID`, Username, `Billing: Full Name` ) | |
SELECT `User ID`, Username, `Billing: Full Name` | |
FROM _customers_import | |
ON DUPLICATE KEY UPDATE Username=values(Username), `Billing: Full Name`=values(`Billing: Full Name`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment