actually, what i suggested was to add two more rows --
id minqty maxqty price
4 0 9 10.00
5 41 999999999 28.00
this will allow you to use an INNER JOIN based on finding the joined quantity within one of the 5 different ranges
the LEFT OUTER JOIN is necessary only when you do not wish to take the simple solution of adding rows 4 and 5
it needs to be a LEFT OUTER JOIN when joining on your quantity, to cover those instances where the quantity is not found within your original three rows, and you need the CASE expression to find those instances, so that you can determine whether the quantity was too high or too low
take my advice, adding rows 4 and 5 is a lot easier
p.s. your Case #1 should say: "If quantity is greater than
40 [maxqty]..."