Kevin's approach is much cleaner. If you have so many OR statements in a query then
Kevin's approach saves lots of string to be parsed by MySQL's query processor.
Thanks,
Hardik
Kevin Ward <[EMAIL PROTECTED]> wrote:
Paul,
You can do the following:
SELECT * FROM tablename WHERE columname IN ('Bob','Mike','Betty');
Kevin
> -----Original Message-----
> From: Paul Fine [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 23, 2004 3:01 PM
> To: [EMAIL PROTECTED]
> 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!
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
---------------------------------
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!