| 
	
 | 
 Posted by Mike C# on 07/07/06 04:30 
The WHERE clause does recognize the OR operator, as in: 
 
WHERE SupportedState1 = 'CA' OR SupportedState2 = 'WA' 
 
Like the others pointed out though, what you should do is look at  
re-designing these tables.  Ideally you should have a separate "supported  
state" table related to the candidates table by the candidate table primary  
key.  This turns your queries into a simple inner join without all the  
explicit "OR" logic, and also allows you to store as many states per  
candidate as you wish.  It also helps enforce referential integrity.  So if  
a candidate only has one or two supported states you won't waste all that  
extra time and programming logic trying to determine this.  Also if your  
requirements change in the future, like if the number of supported states  
suddenly jumps up to 10 per candidate, you won't have to re-design all of  
your tables and queries.
 
  
Navigation:
[Reply to this message] 
 |