Skip to content

Instantly share code, notes, and snippets.

@aderyabin
Created May 28, 2010 15:09
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 aderyabin/417273 to your computer and use it in GitHub Desktop.
Save aderyabin/417273 to your computer and use it in GitHub Desktop.
Remove duplicates from table
SHOW CREATE TABLE old_table;
INSERT INTO new_table SELECT DISTINCT * FROM old_table;
DROP TABLE old_table;
RENAME TABLE new_table TO old_table;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment