Skip to content

Instantly share code, notes, and snippets.

@Kamandlou
Created November 3, 2022 09:06
Show Gist options
  • Save Kamandlou/48e841826c45082d7c2a9a840d5163af to your computer and use it in GitHub Desktop.
Save Kamandlou/48e841826c45082d7c2a9a840d5163af to your computer and use it in GitHub Desktop.
Insert into a MySQL table or update if exists
INSERT INTO t1 (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=c+1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment