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



No comments:

Post a Comment