100%!!!! Many thanks. Much more elegant.

Charlie

-----Original Message-----
From: php_mysql@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of aslam doctor
Sent: 22 May 2008 08:30
To: php_mysql@yahoogroups.com
Subject: Re: [php_mysql] Concise select

Hey Charlie, Try this

SELECT * FROM maintable where
Owner IN(2,3,4)
or Contact IN(2,3,4)
or AccountsContact IN(2,3,4)
ORDER BY DomainName ASC;



On Thu, May 22, 2008 at 12:37 PM, Charlie Markwick <[EMAIL PROTECTED]>
wrote:

>   Is there a more concise way of expressing the following select:-
>
> SELECT * FROM maintable where Owner = 2 or Contact = 2 or 
> AccountsContact = 2 or Owner = 3 or Contact = 3 or AccountsContact = 3

> or Owner = 4 or Contact = 4 or AccountsContact = 4 ORDER BY DomainName

> ASC;
>
> Charlie
>  
>



--
A.M.Doctor


[Non-text portions of this message have been removed]


------------------------------------

The php_mysql group is dedicated to learn more about the PHP/MySQL web
database possibilities through group learning. Yahoo! Groups Links




Reply via email to