Question about order by rand()

2001-06-13 Thread Matt Heaton
I can't seem to find a specificatoin on order by rand() and have a question. Lets say a table has 10,000 rows in it, and I want to get one row that matches so I do a select * from table where number=1 order by rand() limit 1; What if 100 rows match? Does it first get all 100 rows and then

Re: Question about order by rand()

2001-06-13 Thread Peter van Dijk
On Wed, Jun 13, 2001 at 03:25:55PM -0600, Matt Heaton wrote: I can't seem to find a specificatoin on order by rand() and have a question. Lets say a table has 10,000 rows in it, and I want to get one row that matches so I do a select * from table where number=1 order by rand() limit 1;