Banner
Finding Duplicate Records In A Database Table
This is my site Written by ywhitaker on January 15, 2010 – 4:30 pm

The other day, someone asked me if there was a simple way to figure out if a db table contains duplicate records. The answer is yes and the good news is that it’s very easy to do.

Let’s say you have an Employee table and want to find out if it contains any duplicate SSNs. This simple SQL statement will identify any records that share an SSN:

SELECT SSN FROM Employee

GROUP BY SSN

HAVING count(SSN) > 1

 

Posted in  

2 Responses »

  1. Nice post and this enter helped me alot in my college assignement. Gratefulness you as your information.

  2. I found this article useful in a paper I am writing at university. Hopefully, I get an A+ now!

    Thanks

    Bernice Franklin

    UGG Boots

Leave a Reply