Select random line in SQL database

Posted by Jensen on Stack Overflow See other posts from Stack Overflow or by Jensen
Published on 2010-05-27T03:12:31Z Indexed on 2010/05/27 3:21 UTC
Read the original article Hit count: 141

Filed under:
|
|
|

Hi,

I would like to select a random line in my database. I saw this solution on a website:

SELECT column FROM table
ORDER BY RAND()
LIMIT 1

This SQL query run but someone said me that it was a non performant query. Is there another solution ?

Thx

© Stack Overflow or respective owner

Related posts about php

Related posts about sql