Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing double records, math problem
Message
De
15/06/2007 14:54:33
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/06/2007 14:49:26
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:
01233608
Vues:
9
>>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.
>
>..until you com at the end of the process and because table 4 is the last there are not enough records left of table 4 to delete, because you will violate the rule there must be SUM(D1:Dt)-G records deleted. For table 1,2 and maybe 3 everything will go ok, but reaching table 4 you can't do what you want, because some records of table 4 tou will want to delete, but they are the last existing member of a small set of duplicates, so you can't. That's why you have to backtrack at that moment, but how...

Look at my reply to Ed. You check for this before you delete, and I assume you'd have to delete from the table with the least number of deletable records first. You may go round-robin, delete one from each until one's quota is exhausted, then deal with the remaining.

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
Répondre
Fil
Voir

Click here to load this message in the networking platform