Possible Duplicate:
Alerternative to MySQL Order By Rand()
What is an efficient way to query for random result sets in the following scenarios:
- Select a single random row from many.
- Select (at least) n random rows from many.
- Select all rows in a random order.
In particular interested in MySQL, but might be a reason to try out anything else.
(Primary key is a dense AUTO_INCREMENT integer.)