Re: [PHP] newbie sequel question: how do we search for multiple

Re: [PHP] newbie sequel question: how do we search for multiple

am 18.06.2010 22:40:50 von Daniel Brown

On Fri, Jun 18, 2010 at 16:30, Dave wrote:
> SELECT * FROM contacts WHERE state =3D 'CA' and =A0???? name =3D 'bob' or
> name =3D 'sam' or name =3D 'sara' ????

We begin by asking on the right list (mysql@lists.mysql.com, CC'd
by courtesy).

You're on the right track though. Try a WHERE...IN statement:

SELECT * FROM contacts WHERE state=3D'CA' AND name IN ('bob','sam','sar=
a');

--=20

daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg