Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Randomly select n unique codes from 5mln table
Message
 
 
À
09/11/2001 15:31:49
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00579211
Message ID:
00579928
Vues:
29
>>Hi everybody,
>>
>>How can I randomly select n (110) codes from some huge table, so these codes would be unique? I'm trying to create a test case now...
>
>I was forgetting that I had, at some moment, used something like:
>
>
>copy to sample for recno() % 1000 = 0
>
>
>In other words, copy all records whose recno() is a multiple of a certain number.
>
>Quick to code, not so quick in executing.
>
>Hilmar.

That's essentially the same idea, as Mike's. I would first select all unique codes in table, then using some random number, select records for recno()%RandomNumber = 0.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform