Random SQL Query

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:

  1. How to use google effectively
  2. Dont give backlink to spammers
  3. How to preload your web image?

4 comment(s)

  • Jul 22, 2009 by pons from vb gridview treeview asp.net

    Nice concept. do you know any equivalent in sql server

  • Jul 26, 2009 by admin

    Hi pons, I'm not sure what you meant by equivalent... Does mySQL counts?

  • Aug 11, 2009 by Vb Reader

    I just wish to know whether there is any equivalant in Ms Sql Server. the way you have used is very nice and good.

  • Nov 18, 2009 by PSDenise

    Excellent code))

  • Any feedback from you?

    This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.

Aug 30, 2008 by

Want to set up your own web server at home? Read this guide

Super Green Hosting HostGator GreenGeeks WP Web Host green web hosting ad