Find Duplicate Records – SQL Query
July 29th, 2008 | Development
Here’s a real simple query to detect duplicate records (based on a single field). This query works in both MySQL and Microsoft SQL.
SELECT FieldName, COUNT( FieldName ) AS Occurrences
FROM TableName
GROUP BY FieldName
HAVING ( COUNT( FieldName ) > 1 )

