How to check duplicate records in MySQL database?

SQL query statement to find duplicate records in a database table.

SELECT fieldname1, fieldname2, COUNT(duplicatefieldname)
FROM tablename
GROUP BY duplicatefieldname
HAVING COUNT(duplicatefieldname) > 1

 

Tagged: Tags:

Leave A Comment?