-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Sascha Mantscheff writes ..
Try the statement
SELECT *, RAND() AS r FROM myTable ORDER BY r;
The table will not be sorted by the random value field. Do you know
why?
makes sense to me .. how would the SELECT function know what all the
RAND() generated values are going to be ahead of time
my guess is that the RAND() executions are done as each line is
generated .. so with no context MySQL is unable to do the sort
you could use a temporary table if you're post 3.23 .. or create a drop
a table if you're pre 3.23
- --
jason - elep...@squirrelgroup.com -
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.1 for non-commercial use <http://www.pgp.com>
iQA/AwUBOUVFKDYpBpopJvWUEQKNrQCfYYZCn3YUkMXqykSNXKAr8N8iol0AnR/0
esye4OiWdU0HD2AgZZzk7XKh
=ZfQ8
-----END PGP SIGNATURE-----