Mark wrote:
-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] Sent: maandag 14 augustus 2006 4:54
To: Mark
Cc: mysql@lists.mysql.com
Subject: Re: Random SELECT on subset


Hmm, this still does not do what I want:

SELECT columnId FROM queue WHERE processed = '1' ORDER BY RAND() LIMIT 4"

Thanks to you, the query has been greatly simplified, but the result is
still the same: every once in a while (like if I run this twenty times in
a row), I only get 3 items returned, or even 2!

And how many have 'processed=1' at that stage?

I highly doubt it's the rand() doing it - it's your data changing.

If you only have 2 unprocessed items in the queue, then mysql can only ever retrieve 2 results no matter what "limit" you put on it.

The WHERE part of the query is processed before the limit.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to