I have one specific problem and I don’t know how to solve it.
I have DB with a structure:
ID NAME MIN_VALUE MAX_VALUE PERCENT
1 Name1 0 500 40
2 Name2 501 5000 30
3 Name4 5001 5000000 20
Now the question is how can I select “PERCENT” From this db if search string is 1021 (so it’s between 501 and 5000,, and I need to add 30% on some number)
I tried something like:
SELECT * FROM DB WHERE min_value < STRING < max_value
But it’s not working.
Can this be done with MySQL or should I use PHP. But I just don’t have IDEA how to solve this problem.
With kind regards,
Do remember that
BETWEENis all-inclusive, so this code is equivalent to: