Jump to content

[SOLVED] Where with a large series of zip codes


cooldude832

Recommended Posts

I am trying to test for certain postings in my table that have a zip code equal to a larege list of zip codes

so my query would look like

 


select myfield from `postings` where zip = '12345' || zip = '45678' || zip = '166666' etc. etc.  AND USER = $userid

 

There is my problem I want it to be any of those zip but the user must be that user id, so if I have || || || it will be true on any user so long as it finds a matching zip right?

 

can I do something like

 

select myfield from `postings` where zip = ('12345' || '45678' || '66666')  AND USER = $userid

 

But I dont know the proper sytnax

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.