How to select Random with MySQL

12 November 2010 by Rick ~ 0 Comments 853 views

Select random rows from a database base with MySQL

The following query would return 1 random row from the data table:

SELECT * FROM `data` ORDER BY RAND() LIMIT 0,1;

Subscribe by E-mail:

« »
Add a Comment

Use [code] example piece of code [/code] to insert code into your comment.