How to select a random row in MySQL

To select a random row in MySQL you can use the following query.

Sample MySQL

SELECT COLUMNNAME FROM TABLENAME ORDER BY RAND() LIMIT 1

Please Share us:
Please rate this snippet

One thought on “How to select a random row in MySQL

Leave a Reply