I have table medicine record with fields
Name qunty min expiry
a 2 3 14/2/2012
b 4 1 15/12/2010
a 5 3 16/5/2012
I have to select medicine which has qunty less than min value . Two rows can exist with same name but with different expiry . So in that condition i have to add qunty of same name row and than match with min value .
try this one,
SQLFiddle Demo
in that case i have also a question with you, are
minvalues constant for the same name?