List:General Discussion« Previous MessageNext Message »
From:Gabriel Ricard Date:October 15 2003 8:19pm
Subject:Re: OR in MySQL statement?
View as plain text  
You can do it exactly like that, or you could use the IN() syntax if 
you have a large number of values to check.

SELECT * FROM list WHERE name IN('$this1', '$this2', '$this3')

- Gabriel

On Wednesday, October 15, 2003, at 04:16  PM, Mike At Spy wrote:

>
>
> How could I write a statement that uses something like 'OR' as a case. 
>  Like
> this:
>
> SELECT * FROM list WHERE name = '$this1' OR name = '$this2' OR name =
> '$that1'
>
> ?
>
> Thanks for any help,
>
> -Mike
>
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?unsub=1
>

Thread
OR in MySQL statement?Mike At Spy15 Oct
  • Re: OR in MySQL statement?Gabriel Ricard15 Oct
  • Re: OR in MySQL statement?Dan Nelson15 Oct
  • Re: OR in MySQL statement?Colleen Dick16 Oct
  • Re: OR in MySQL statement?Nitin16 Oct