Find duplicate records
📝 SQLThis SQL snippet helps you find duplicate records by grouping on key columns and filtering for counts greater than one.
SQL
SELECT keycolumn1, keycolumn2, COUNT() as duplicatecount
FROM tablename
GROUP BY keycolumn1, keycolumn2
HAVING COUNT() > 1;
Comments
I've used this exact pattern to clean up a messy CRM import where customers were duplicated by email. Saved hours of manual matching.