Board index » delphi » Fastest way to find duplicates in database?

Fastest way to find duplicates in database?

Which is the fastest way to find duplicate numbers in a unsorted field in a
paradox database.

I have tried table.fieldbyname('Cust No').asstring - but it is extremely
slow. There are about 3500 records in the database. I'm not sure how to use
findnext, etc because I don't know how to set the filters.

Please Help
Kevin

 

Re:Fastest way to find duplicates in database?


In Paradox (QBE):
        Checkmark the key field and enter "count > 1, calc count all."
        Run the query.

In SQL:
        Select count(*) from table1 group by key having count(key) > 1

(notice "having" vs. "where")

Extemporaneous coding :-) your results may vary.

Quote
>me wrote:
> Which is the fastest way to find duplicate numbers in a unsorted field in
> a paradox database.

> I have tried table.fieldbyname('Cust No').asstring - but it is extremely
> slow. There are about 3500 records in the database. I'm not sure how to
> use findnext, etc because I don't know how to set the filters.

> Please Help
> Kevin

----------------------------------
Fast automatic Paradox table repair at a click of a mouse!
http://www.sundialservices.com/products/chimneysweep

Other Threads