Re: Using LIMIT to select random rows

2002-01-29 Thread Michael Widenius
Hi! > "Ulf" == Ulf Harnhammar <[EMAIL PROTECTED]> writes: Ulf> On Sun, 27 Jan 2002, Michael Widenius wrote: >> One way to do this is to do as follows: >> SELECT something FROM sometable WHERE somevar=somevalue ORDER BY >> RAND() LIMIT 10 Ulf> OK. I still think that my extended LIMIT syntax

Re: Using LIMIT to select random rows

2002-01-29 Thread Ulf Harnhammar
On Sun, 27 Jan 2002, Michael Widenius wrote: > One way to do this is to do as follows: > SELECT something FROM sometable WHERE somevar=somevalue ORDER BY > RAND() LIMIT 10 OK. I still think that my extended LIMIT syntax would be a good idea, because ORDER BY RAND() does not seem to be very fast

RE: Using LIMIT to select random rows

2002-01-28 Thread Gordon
This is an example from MySQL's class on Using MySQL MySQL> Select Name -> From Country -> Where Continent="Europe" -> Order By RAND() -> LIMIT 1; If you do Limit 3 you should get 3 random rows. -Original Message- From: Ulf Harnhammar [mailto:[EMAIL PROTECTED]] Sent: We

Re: Using LIMIT to select random rows

2002-01-27 Thread Michael Widenius
Hi! > "Sinisa" == Sinisa Milivojevic <[EMAIL PROTECTED]> writes: Sinisa> Ulf Harnhammar writes: >> This is a suggestion for a small addition to MySQL's syntax which I'm >> proposing, unless someone is kind enough to show me that there already is >> equivalent functionality somewhere else in