I've got a table in SQL Server 7 that has almost-duplicate records: they're identical except for a keynumber. I don't know how they got there, but they must go! I've built a query that joins the table to itself and selects out all the records that have duplicates, and their duplicates.<br>(query edited for brevity)<br> select distinct a.* from thetable a<br> full outer join thetable b<br> on ((a.productname=b.productname) and a.Location=b.Location))<br> where a.KeyNumber <> b.KeyNumber<br> order by a.productname;<br><br>If I could get a result set of only the duplicates, I could use it to purge the table. Using the results of this query would purge ALL of the records that have dupes.<br><br>Any ideas on how to get this?