General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Network:
Windows 2003 Server
Lennert,
on the top of my head, dont have time to check further I would go as follows:
1st step create a temp.dbf with field(1) nRecno i, field(2) nSeqnbr i field(3) nTablnr i and all other fields from your tables 1 till 4 have
2nd step to append everything into this temp while n Recno indicates the the recno of your imported table, nTablnr a reference to your table and empty the original dbf's
3rd step fill field(2) with an atrandom number making sure this is an unique number in your temp.dbf (there is an alorgithm for this, which I can't find just this instance)
4th step sort the temp.dbf on your keyfield + nSeqnbr
5th step scan and the first recno of a 'new set' (unique nmbrs are a set of 1) is marked as .t. the remaining of that set are marked as .f.
6th step delete all for .f.
7th step reverse the remaining into your empty table1 to table4
Your whish to deleted equaly over the 4 tables according to their weight will surely end up with even if you find an alorgithm into loosing reccords due to rounding.
Good Luck, and report back if you dont find the unqiqe atrandom number generator.
Koen
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only