adding additional criteria to MIN( sub query

T

TC

I am using the following query to return the minimum value for the "length"
field.
SELECT O1.pattern, O1.hole, O1.tag_time, O1.length, O1.rate
FROM penetration AS O1
WHERE length =
(SELECT MIN(length)
FROM penetration AS O2
WHERE O2.hole = O1.hole);

I would like to add the following criteria but I am not sure where to add it
to the sql statement.
WHERE (((01.length)>10) AND ((01.rate)>=300))

Any ideas or solutions would be greatly appreciated.
Thanks
Tim
 
O

Ofer Cohen

Try

SELECT O1.pattern, O1.hole, O1.tag_time, O1.length, O1.rate
FROM penetration AS O1
WHERE length =
(SELECT MIN(length)
FROM penetration AS O2
WHERE O2.hole = O1.hole And O2.length>10 And O2.rate>=300)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top