Skip to content

Instantly share code, notes, and snippets.

@meeDamian
Created May 23, 2012 12:38
Show Gist options
  • Save meeDamian/2775046 to your computer and use it in GitHub Desktop.
Save meeDamian/2775046 to your computer and use it in GitHub Desktop.
[ Mysql | hacks ] Easy updateing on duplicate
-- will work only if theres a key or unique of any kind
INSERT INTO tabela ( name, content )
VALUES
('jakasNazwa', 'Jakaś Wartość'),
('jakasNazwa2', 'Jakaś Wartość 2')
ON DUPLICATE KEY
UPDATE content = VALUES( content );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment