Skip to content

Instantly share code, notes, and snippets.

@anchoo2kewl
Last active August 29, 2015 14:01
Show Gist options
  • Save anchoo2kewl/e75f61b2b6536fb90f7b to your computer and use it in GitHub Desktop.
Save anchoo2kewl/e75f61b2b6536fb90f7b to your computer and use it in GitHub Desktop.
Delete all the duplicate entries from a table
DELETE FROM xyz where id in ( SELECT id from (SELECT id
FROM xyz
GROUP BY
name
HAVING COUNT(*) > 1) as newXYZ)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment