sql: DISPLAY COUNT OF DUPLICATE RECORDS

December 18th, 2008

This simple example will display count of duplicate records in a given table:

SELECT field1, count(*)
FROM table1
GROUP BY field1
HAVING count(*) > 1
ORDER BY COUNT(*) desc

Filled Under: SQL