I'm having a brain fart and can't think of the best way to call this query.
basically what I have to do is take the first 3 numbers of a zip code and compare that with a range of numbers to give a zone
my zone table
їcode]
zone zip1 zip2
2 900 933
3 934 934
7 600 639
ї/code]
so basically if the zip is 922 then the zone = 2
I can get the first 3 numbers fine with substring but its the actual query call I'm having probs with. Maybe I even setup the table wrong.
anyone? thanks!
query help :(
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
http://www.mysql.com/doc/en/Comparison_Operators.html
Check out BETWEEN:
untested but it's probably something like that...
Mac
Check out BETWEEN:
Code: Select all
SELECT zone FROM table WHERE code BETWEEN zip1 AND zip2Mac