Select a random row from a table

Posted on December 22, 2007
Filed Under SQL | Leave a Comment

I was looking for a clean and simple way of selecting a random record from a table. Here is what I found…

1
SELECT * FROM TABLE ORDER BY RAND() LIMIT 1
  • About

    This is an area on your website where you can add text. This will serve as an informative location on your website, where you can talk about your site.