How to select Random with MySQL

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;Code language: JavaScript (javascript)

Leave a Reply

Your email address will not be published. Required fields are marked *