Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting a Winner
Message
From
14/06/1999 08:50:38
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
 
 
To
06/06/1999 10:58:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00226460
Message ID:
00229391
Views:
26
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform