On 12 July 2010 18:34, Tommy Pham <[email protected]> wrote:
> SELECT srs.Name FROM SMS_R_System srs WHERE srs.SystemOUName IN
> ("example.com/COMPUTERS/MAIN CAMPUS/ABC", "example.com/COMPUTERS/MAIN
> CAMPUS/XYZ")
>
As this is a single table query, there is no need for the table alias.
SELECT Name FROM SMS_R_System WHERE LEFT(SystemOUName, 34) =
'example.com/COMPUTERS/MAIN CAMPUS/' AND RIGHT(SystemOUName, 3) IN
('ABC', 'XYZ')
But this will probably take a measurable amount of time longer to
execute - 2 comparisons and 2 string processes. Maybe not for a single
run, but after several hundred.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php