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
>Our company is creating a sweepstakes application that will randomly select a winner each month. We are having difficulty putting code together that will help us select a winner. We are using one table that has two fields in it. A three letter code (AFS) field and a dateime field. Does anyone have any simple code that might be helpful in selecting a winner or have any ideas on how to generate a winner.
>
>Thanks in advance
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only