Skip to content

Instantly share code, notes, and snippets.

@AlexPashley
Created July 3, 2013 21:54
Show Gist options
  • Save AlexPashley/5923194 to your computer and use it in GitHub Desktop.
Save AlexPashley/5923194 to your computer and use it in GitHub Desktop.
SQL: Delete duplicate rows from a mysql table
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