I’m searching for a solution where I can get results based on a field value directly in my sql statement.
For example if I have the following structure:
calculated_result result_one result_two result_three
1 2.50 3.40 2.90
2 1.90 2.00 3.90
1 1.30 2.23 1.50
Then I want to make a search, where it should return all results where calculated_result is 1 and result_one is higher that 2.30 and smaller or equal to 2.65.
The problem is, that I don’t know how to only return rows that fits into the search the user is making.
calculated_result = 1 should check for result_one is bigger and smaller than the rows content
calculated_result = 2 should check for result_two is bigger and smaller than the rows content
etc
Hope it makes sense.
or, if you wanted to use
case