adding additional criteria to MIN( sub query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
Back
Top