Does ORDER BY RAND(N) work on all versions of MySQL? I'm running the exact same query on MySQL 4.0.13 and MySQL 3.23.58 and it only works on 4.0.13. I'm trying:
SELECT * FROM members WHERE status='active' ORDER BY RAND(12)
The 12 is a random number generated by php, it is different every time someone logs in.
The manual doesn't say anything:
RAND(N)
Returns a random floating-point value in the range from 0 to 1.0. If an integer argument N is specified, it is used as the seed value (producing a repeatable sequence).
mysql> SELECT RAND();
-> 0.9233482386203
mysql> SELECT RAND(20);
-> 0.15888261251047
mysql> SELECT RAND(20);
-> 0.15888261251047
mysql> SELECT RAND();
-> 0.63553050033332
mysql> SELECT RAND();
-> 0.70100469486881