Page 1 of 1

how to select random rows

Posted: Sat May 20, 2006 2:02 am
by itsmani1
I want to select two random rows form databse, one option could be i use rand() after selecting all rows.
is there any other way.


thanks.

Posted: Sat May 20, 2006 4:06 am
by timvw
You can order by rand and limit if you're using mysql... most other sql dbms have similar functions... check the manual..