Monday 24 September 2018

Selecting a Random Row from Table in MySQL

Here the simplest way of selecting random rows from the MySQL database with using "ORDER BY RAND()" clause in the query.


SELECT * FROM TABLE ORDER BY RAND() LIMIT 1


Previous Post
Next Post

post written by:

0 Comments:

Hit me with a comment!