I have a column with a bunch of rows with values like this.
ZIP ——– Value
010-212 — 8
214-268 — 9
270-324 — 7
I am submitting a value like 245 to mysql and trying to figure out a way to grab the associated number, which would be 9 in this case.
How would I go about writing a mysql statement and being able to tell if the number was in-between the two values in the zip row, for this example in-between and including 214-268 then use that to grab the associated value which is 9?
I feel as if I have to use SUBSTRING some how but am not sure how to go about writing it.
Any ideas?
Just for your knowledge
I totally agree with James’ advice.