Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete Duplicates in file
Message
De
14/08/2007 23:33:38
Neil Mc Donald
Cencom Systems P/L
The Sun, Australie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Delete Duplicates in file
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01248185
Message ID:
01248185
Vues:
77
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform