select min(lead), max(lead)
from products
WHERE part_line != 90 and category = 'x'
When I run the above query the min returned is larger than the max. If I remove the condition pline != 90 the problem goes away.
I was thinking at first that mysql was processing the min, max before it got to pline... but that doesn't explain why it would assign a higher min.
What gets me, when I get the avg() it calculates correctly.
What's going on?