-------- Original Message --------
Subject: Re: Searching for matching zipcode in a list of (ranges of) zipcodes
Date: Wed, 14 Jan 2004 14:14:19 +0100
From: Mirza <[EMAIL PROTECTED]>
To: Tom Hesp <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
Hi, If you rewrite ranges 3612-3621 to have all elements named (3612, 3613,... , 3621), you can use fulltext search to find matching engineers. Users can still enter 3612-3621 to it's frontend application, but you must write all numbers to database. hope this helps, mirza
Tom Hesp wrote:
Hi all,
I am looking for a simple solution to find a zipcode in lists of zipcodes.
I have a table with customer data including the customer's zipcode and a table containing information about service engineers. The service engineers can define a list of zipcode (ranges) of areas they want to (or are able to) service. An example of such a list is: 3528,3529,3612-3621,3828. This list is stored in one field in the service engineer table.
What I would like to do is by using the customer's zipcode select all engineers that have that zipcode in their list. E.g. 3529 & 3615 would match while 3530 would not in the above example. I can of course code this in perl, for example, but that would mean that for every search I need to do I would have to retrieve the entire service engineer table and go through it to find a match. I was hoping MySQL would have function to this. I searched the documentation but have not been able to find any.
Thanks for your time.
Kind regards, Tom Hesp
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]