Re: newbie sequel question: how do we search for multiple things on 1 field like:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

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

    SELECT * FROM contacts WHERE state='CA' AND name IN ('bob','sam','sara');

-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux