Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing double records, math problem
Message
De
15/06/2007 14:52:18
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/06/2007 14:41:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01233421
Message ID:
01233605
Vues:
8
>You take it too literally. 'Duplicates' in one table means that you check records against the cursor that holds all duplicate records. If it's there then it could be deleted.
>The deletion itself can proceed in a very straightforward way: as soon as you determined that 120 records should be deleted in Table1 then you just go, scan and delete first 120 records that qualify. Next you go to Table2 and do the same, etc.

And to make that more evenly distributed across the table, if in table1 there are 300 deletable records, you make a list of their keys (or record numbers), and pick from that list at random until you've deleted 120. You also need to remove the selected ones from the lists for other tables as well, or from the global list of duplicates (as soon as there's more than one candidate for each set of duplicates).

I like this better than my first solution.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform