Skip to content

Instantly share code, notes, and snippets.

@cramhead
Created September 13, 2019 20:26
Show Gist options
  • Save cramhead/5d6d7c233be32668ef7ce76cfc828091 to your computer and use it in GitHub Desktop.
Save cramhead/5d6d7c233be32668ef7ce76cfc828091 to your computer and use it in GitHub Desktop.
Updates rows when the ids conflict with existing data
INSERT INTO user (id, uid) VALUES (1, 'uid1'), (2, 'uid2'), (3, 'uid3') ON DUPLICATE KEY UPDATE id=VALUES(id), uid=VALUES(uid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment