Monday, April 6, 2009

Finding Duplicate Records

A very easy way to find duplicate database records:

SELECT Id FROM aTable GROUP BY Id HAVING (COUNT(Id) > 1)

Assuming "Id" is the field for which you want to find duplicates. Found here http://imar.spaanjaars.com/QuickDocID.aspx?QUICKDOC=218.