Five second rule« an older post
a newer one »Peanut butter cookies

Return random records in MySQL

Interesting

Works only for relatively small tables.


SELECT field1, field2, field3 FROM mytable WHERE status = 1 AND otherfield = 'somevalue' ORDER BY RAND();

One of many sources:
http://davidwalsh.name/return-random-records-mysql