Mark wrote:
Dear MySQL-ers,

Using MySQL 4.1.20, I'm trying to do a complex query on a subset; well,
complex to me, that is. :)

In Perl, I'm trying to get 4 random entries from a subset "WHERE processed
= '1'" and "columnId" is unique. Like so:

$sth = $dbh->prepare ("SELECT columnId FROM queue WHERE columnId >=
(SELECT FLOOR(MAX(columnId) * RAND()) FROM queue) IN (SELECT columnId FROM
queue WHERE processed = '1') ORDER BY columnId LIMIT 4");

I'm not even sure what you're trying to get here!

Could you provide some sample data (5 rows) and what you want the query to return?

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

Reply via email to