Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing double records, math problem
Message
De
16/06/2007 03:10:35
 
 
À
15/06/2007 08:54:06
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:
01233710
Vues:
8
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform