Posted By

apphp-snippets on 03/12/13


Tagged

select sql random row


Versions (?)

Selecting a Random Row from Table in MySQL


 / Published in: PL/SQL
 

URL: http://www.apphp.com/index.php?snippet=mysql-selecting-random-row

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

  1. ORDER BY RAND()
  2. LIMIT 1

Report this snippet  

You need to login to post a comment.