I have a select I'd like to do...I have 2 kinds of people -- those
needing interviews, and those doing interviews.  Among other things,
each person has their home address/phone in the tables.  I want to
generate lists of interviewers in close geographical proximity to the
interviewees.  I can do the city check easily of course, but I'm
stumped on telephone exchanges and zipcode matches.

The telephone numbers are stored as char[12] (three digits, dash,
three digits, dash, four digits).  I want to compare the second
set of three digits to each other, something like

  WHERE Interviewee.homephone[4-6] = Interviewer.homephone[4-6]

Similarly for zip codes, I want to compare the first three characters
of a char[10] (zip plus 4], essentially

  WHERE Interviewee.zip[0-2] = Interviewer.zip[0-2]

Are these types of comparisons possible?  If so, what's the syntax?  I
couldn't find anything in the online documentation, though it's
possibly not called "slicing" or "string range"...

--Cindy
-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to