Skip to content

Instantly share code, notes, and snippets.

@endel
Created May 17, 2011 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endel/975835 to your computer and use it in GitHub Desktop.
Save endel/975835 to your computer and use it in GitHub Desktop.
Remove duplicate entries from MySQL table.
DELETE FROM table1
USING table1,
table1 as table2
WHERE table2.id > table1.id
AND table2.unique_param = table1.unique_param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment