Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing double records, math problem
Message
From
15/06/2007 14:52:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/06/2007 14:41:56
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:
01233605
Views:
9
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform