I have a table with four columns, the first with a type, the second with the minimum value, the third with the max value, and the fourth with the data that I want. I need to select the value of the fourth column when the type is in the table and the value entered is between the maximum and minimum value, I tried to do this:
SELECT VALOR FROM TABELA WHERE TIPO = 1 AND MINIMO <=0.3 AND MAXIMO >= 0.3;
TIPO MINIMO MAXIMO VALOR
1 0 0,15 0
1 0,2 0,29 8,1
1 0,3 0,54 7,97
1 0,55 5 7,42
For the table above, the value should be 7.97, but not correct. If I try to change the 0.3 by 0.31, I get the desired result.