For my next project I need a sql query for mysql which retrieve random row. After some browsing, I found the sql query. Here it is:
SELECT * FROM table
ORDER BY RAND()
LIMIT 1
Related posts:
For my next project I need a sql query for mysql which retrieve random row. After some browsing, I found the sql query. Here it is:
SELECT * FROM table
ORDER BY RAND()
LIMIT 1
Related posts:
4 comment(s)
Track this comments via RSS 2.0 feed. Feel free to post the comment, or trackback from your web site.
Nice concept. do you know any equivalent in sql server
Hi pons, I'm not sure what you meant by equivalent... Does mySQL counts?
I just wish to know whether there is any equivalant in Ms Sql Server. the way you have used is very nice and good.
Excellent code))
Any feedback from you?