Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete Duplicates in file
Message
From
14/08/2007 23:33:38
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Delete Duplicates in file
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01248185
Message ID:
01248185
Views:
75
Hi,

I am trying to clean up duplicates in an existing database.

The problem is that with the select statement below I am getting the record number of the cursor dups and not the record number of the file xpat.

Any ideas.
SELECT RECNO() as recno, xpat.patid, xpat.lastname, xpat.firstname ;
FROM xpat ;
  JOIN ( ;
   SELECT xpat.patid, COUNT(*) AS nCount ;
      FROM xpat ;
      GROUP BY patid HAVING nCount > 1) Dups ;
   ON xpat.patid = Dups.patid ;
   ORDER BY xpat.patid, xpat.lastname ;
   INTO CURSOR HasDups

Join Dups and delete all but lowest record number
Regards N Mc Donald
Next
Reply
Map
View

Click here to load this message in the networking platform