Finding Duplicate Records in MySQL

Digging around today I found a query that will identify duplicate records in a MySQL database.


SELECT id, count(*) as n
FROM table_name
GROUP BY id
HAVING n > 1

This entry was posted in Geek and tagged , , . Bookmark the permalink.

Leave a Reply