Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting a Winner
Message
De
14/06/1999 08:50:38
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, États-Unis
 
 
À
06/06/1999 10:58:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00226460
Message ID:
00229391
Vues:
25
>To all those trying to use

>select top 1 rand()*1000000 bla bla

>to select one record randomly from a table:
This method is not correct and the result will depend on the physical order of the database. (Because there may be more than one record with the same rand()*1000000 value and you'll take only one of them.) This is not random.

>Vlad

Vlad,

I disagree. Random does not necessarily mean unique. If you want to make sure you do not select the same person, then store the previous winners in a table for comparison. However, unless you can show me a predictable algorithm used by SELECT TOP 1 RAND()*1000000 etc. then it is random.

George
George Simon, MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform