I have a table that is only supposed to have one record per ID, however, during a data import, some(many) records have been duplicated. Is it possible to write a query that will return the rows that have a duplicate(or more) entry for the ID field?
Here is a variation of RosKo's that should run a little more efficiently, and provides a count of the duplicated records (if that is something you would like.)
select id, Count(*) as TheCount
from YourTable
Group by id
having count(*) > 1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.