Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-Sql help needed
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00751340
Message ID:
00752112
Vues:
17
Nadya,

>BTW, I have a FAQ here about getting rid of duplicates. I will check it, if it's ANSI complaint...

Thanks for this. I modified your code a little as in the following to get rid of duplicates within a table. It seems pretty fast in my testing so far.
* Following scans and deletes duplicates. It requires
* that the table be sorted on the field we are checking
* duplicates for (which I do in the SELECT statement).
*
* We start off with a lnKeyID of 0 so that the first
* record will not be deleted.
* 
* MyKeyFldID =  the field we are checking duplicates on.
lnKeyID = 0
SCAN 
 * If the following is True, it means
 * it is a duplicate which needs to be deleted.
  IF lnKeyID  = MyKeyFldID
    DELETE
  ENDIF
  * We are storing either the same MemberId (in which case we will delete
   * this record upon next scan) or a new record which will not be deleted.
   lnKeyID = MyKeyFldID
ENDSCAN
Thanks for the help.

Mel Cummings
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform