Need help building a query. I have a table of quantities, prices and the corresponding price, as shown below
Quantity price
----------------
1 - β¬ 175.35
2.5 - β¬ 160,65
5 - β¬ 149.10
10 - β¬ 143.85
thus, for quantities up to 1, the quantity will be from 175.35 to 2.5, it will be 160.65, and so on. For more than 10 quantities, the price will remain up to 143.85.
Now, if my quantity is 1.5, the request should return the price of 160.65, that is, find how much the range is in, and then get the price of the maximum quantity in the range.
source
share