Hello everyone,
 
Below you will find the answer kindly submitted by Mr. Chris Perry to a question I sent last year about finding duplicates records.  It certainly worked me.
 
Regards,
 
Miguel Iturralde
[EMAIL PROTECTED]
 
 

To find the duplicates from for example COL1, use SQL select (assuming YOURTABLE is your table name):
Select: COL1, Count(*) "COUNT"
from: YOURTABLE
where:
Group By: COL1
Order By: COUNT desc

All the records which have more than one in the COUNT column will be duplicates.  To select only those, now perform another query (assuming the first query returned "Query1"):
Select: *
From: Query1
Where COUNT > 1

Now to select all the duplicates from your original table, join the two:
Select: *
From: YOURTABLE,QUERY2
Where: YOURTABLE.COL1=QUERY2.COL1


Reply via email to