PHPBuilder - Getting a random row (req. MySQL 3.23+)



RSS Twitter
Tips Databases

Getting a random row (req. MySQL 3.23+)

by: Vincent
|
August 22, 2000

If you need to fetch a random row from a table using MySQL version 3.23 or newer:

select * from your_table order by rand() limit 1;

Note this does not / may not work with MySQL version older than 3.23.

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Vincent

Comment:



Comment:

(Maximum characters: 1200). You have characters left.