MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Kevin Ward Date:July 23 2004 10:02pm
Subject:RE: Another newbie question - using OR in WHERE clauses
View as plain text  
Paul,

You can do the following:

SELECT  * FROM tablename WHERE columname IN ('Bob','Mike','Betty');

Kevin

> -----Original Message-----
> From: Paul Fine [mailto:pfine@stripped] 
> Sent: Friday, July 23, 2004 3:01 PM
> To: mysql@stripped
> Subject: Another newbie question - using OR in WHERE clauses
> 
> Is there a simpler way to write something like:
> 
>  
> 
> SELECT  * FROM tablename
> 
> WHERE columname = 'Bob' OR columname = 'Mike' OR columname = 'Betty'
> 
>  
> 
>  
> 
> Clearly this does not work:
> 
> WHERE columname = 'Bob' OR 'Mike' OR 'Betty' 
> 
>  
> 
>  
> 
> Thanks!
> 
> 

Thread
Another newbie question - using OR in WHERE clausesPaul Fine23 Jul
  • RE: Another newbie question - using OR in WHERE clausesKevin Ward24 Jul
  • Re: Another newbie question - using OR in WHERE clausesScott Haneda24 Jul
RE: Another newbie question - using OR in WHERE clausesHardik Doshi24 Jul