Skip to content

Instantly share code, notes, and snippets.

@sabarasaba
Created November 13, 2011 03:00
Show Gist options
  • Select an option

  • Save sabarasaba/1361520 to your computer and use it in GitHub Desktop.

Select an option

Save sabarasaba/1361520 to your computer and use it in GitHub Desktop.
Delete duplicates from a mysql table.
DELETE FROM someTable
USING someTable, someTable as virtualTable
WHERE (NOT someTable.id = virtualTable.id)
AND (someTable.name = virtualTable.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment