Showing posts with label Count duplicates. Show all posts
Showing posts with label Count duplicates. Show all posts

Friday, July 20, 2012

Get duplicates records in SQL

What are we cooking today? A query to count duplicates


SELECT ColumnXCOUNT(*) as  TotalCount
FROM TableY
GROUP BY  ColumnX 
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC