Showing posts with label SQL duplicates MS tables. Show all posts
Showing posts with label SQL duplicates MS tables. Show all posts

Thursday, August 12, 2010

Am I seeing double --Find duplicates in a sql table

Find duplicates in your table.
This is an example for a database called instructapp and table called teacherInfo and a column called SSN

USE instructapp
SELECT SSN, COUNT(*) TotalCount
FROM teacherInfo
GROUP BY SSN
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC