Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing double records, math problem
Message
From
15/06/2007 14:54:33
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
15/06/2007 14:49:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01233421
Message ID:
01233608
Views:
10
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform