List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:October 15 2003 8:25pm
Subject:Re: OR in MySQL statement?
View as plain text  
In the last episode (Oct 15), Mike At Spy said:
> 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'

Exactly like you wrote it.  You can also use WHERE name IN ('this1', 'this2',
'this3'), which is a bit shorter.

	Dan Nelson
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