in reply to Perl and MySQL - getting a random record
Three quick thoughts:
- Which version of mySQL? ORDER BY RAND() only works in 3.23 and up.
- I work on a site where this kind of thing is used and it appears that the RAND() is not very random at all in the current version of mySQL. It "prefers" the first record in the table to a very obvious degree
- Random is random. Picking one out of three is one of three possible outcomes -- who's to say it's wrong? How many times did you try?
--
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
M-J D