Created
July 3, 2013 21:54
-
-
Save AlexPashley/5923194 to your computer and use it in GitHub Desktop.
SQL: Delete duplicate rows from a mysql table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM table1 | |
USING table1, table1 AS vtable | |
WHERE vtable.id > table1.id | |
AND table1.field_name = vtable.field_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment