Skip to content

Instantly share code, notes, and snippets.

@blar
Created February 12, 2011 09:46
Show Gist options
  • Save blar/823652 to your computer and use it in GitHub Desktop.
Save blar/823652 to your computer and use it in GitHub Desktop.
INSERT INTO … ON DUPLICATE KEY UPDATE
INSERT INTO
table(id, title, created, modified)
VALUES
(NULL, 'foo', NOW(), NOW()),
(NULL, 'bar', NOW(), NOW())
ON DUPLICATE KEY UPDATE
modified = VALUES(modified);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment