You are here: Re: OR in the WHERE Clause? « MsSQL Server « IT news, forums, messages
Re: OR in the WHERE Clause?

Posted by Jack Vamvas on 07/03/06 09:03

Redesign your db, i.e instead of a table with the 5 supported states
columns , set up a lookup table , and then a table with 2. columns i.e
candidateId | SupportedStaeID |

--
----
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________


"Alex" <iamalex84@gmail.com> wrote in message
news:1151703920.810636.228800@75g2000cwc.googlegroups.com...
> I am trying to create a system that will select candidates for a job
> based on certain criteria (i.e. Supperted States)
>
> The candidates are allowed to choose up to 5 supported states. The
> problem comes when creating the query to pull the candidates out.
>
> I can get it to work with only one supported state, no problem. But I
> have no idea how to tell the DB to look through SupportedState1 OR
> SupportedState2 OR SupportedState3 OR SupportedState4 OR
> SupportedState5 to find the particular state that the job is in.
>
> Does an OR operator exist; or at least some mechanism for achieving
> this? Maybe there is a smarter way to implement this instead of 5
> seperate fields for the supported states?
>
> Thanks so much,
> Alex
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация