Page 1 of 1

selecting randon records with a select statement....

Posted: Fri Jan 02, 2004 6:48 pm
by mccommunity
selecting randon records.... is there a way to do a select statement and select only random items so instead of select * from table limit 10 you could do select random from table limit 10 ? Any help is appreciated. Thanks.

Posted: Fri Jan 02, 2004 8:11 pm
by redmonkey

Code: Select all

SELECT * FROM `table` ORDER BY RAND() LIMIT 10
Is the quick and easy way of doing it, can become quite slow on large tables though