Delete Duplicate Records from Database


Sometimes it is required to delete duplicate records from DB .

DELETE FROM Table_name
WHERE id NOT IN(
SELECT MIN(id) FROM Table_name
GROUP BY Duplicate_column)


Comments

Author: anju12 Nov 2010 Member Level: Silver   Points : 0

Good. It works.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: