Reputation: 1715
SELECT fileUser FROM `images`
HAVING min(imageid) AND
WHERE (finished=0 and processing=0)
It seems a simple thing to get the fileUser
index with the least imageID
where finished and processing also = 0. But, I cannot seem to come up with a query that works? Any help would be great.
Upvotes: 1
Views: 80
Reputation: 32622
If you question is related to your previous question, then you can try this one:
SELECT fileUser FROM `images`
WHERE imageid = (SELECT min(imageid)
FROM `images`
WHERE finished=0
AND processing=0)
Upvotes: 2
Reputation: 9528
An alternative way would be
SELECT fileUser
FROM `images`
WHERE finished=0
AND processing=0
ORDER BY imageid
LIMIT 1
Upvotes: 1
Reputation: 2343
I think he actually wants this
SELECT fileUser FROM `images`
WHERE imageid = (SELECT min(imageid) FROM `images` WHERE (finished=0 and processing=0))
Upvotes: 0