Ed Pollack (4/29/2014)
Comments posted to this topic are about the item <A HREF="/articles/Duplicate/109019/">Duplicate Detection and Management</A>
First of all, check for the existence of a created/changed timestamp you might use to define a subset of the records. Depends on how the duplicates came to be created by the code
Maybe the easiest and simplest way is still the good old query:
SELECT A, B, C, COUNT(A)
GROUP BY A, B, C
ORDER BY A, B, C
HAVING COUNT(A) > 1
That may not be exact code 'cause I'm an old retired guy and haven't done this for a few years, but the example is close and will tell you how many of each set exist. Just group by all fields or as many at a time as you need and that the GROUP BY syntax allows, using temp tables or subqueries and SELECT DISTINCT as needed. Can't remember if you can just do a SELECT DISCTINCT * to get one of each identical set or not. Also can't recall if there is a limit on the GROUP BY and/or ORDER BY, and I'm too lazy to look it up.
Play with it. It's fun, even when you get too old to remember. It's 5:00 somewhere.