Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting 10 records randomly
Message
 
À
03/01/1998 23:53:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00069291
Message ID:
00069297
Vues:
35
>>>What would be the best technique to select 10 records randomly from a table?
>>Michel, do you mean by RECNO() ?
>
>I have a set of 250 records. Depending on the SQL, I may have a total of 135 records approx. for the SQL result set. From those, I would like to select 10 records randomly.
>
>I tried various techniques but I don't like them. I figured their must be something better.

I always used just basic
=rand(-1)
x=rand()
and then make a value from X some way, corresponding the necessary range.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform