I have a table like below and I want to find the range of inputted number. ex) if users enters 84, MySql query returns B.
Rank Range_Start Range_End
A 90 100
B 80 89
C 70 79
.
.
H
I 0 10
What about:
SELECT Rank FROM tbl WHERE Range_Start < my_value AND Range_End > my_value
Or (if you don't need strict inclusion):
SELECT Rank FROM tbl WHERE my_value BETWEEN Range_Start AND Range_End
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments