List:General Discussion« Previous MessageNext Message »
From:Chris Knipe Date:August 17 2002 9:44pm
Subject:where clause structures
View as plain text  
Lo everyone,

I seem to be having a problem with the structuring of my query - more
specifically, with the WHERE clause...

mysql> SELECT ZoneName
    ->   FROM CompanyDNSZones
    ->   LEFT JOIN CompanyDetails ON
    ->   WHERE CompanyDetails.CompanySuspended='0' AND
    ->         CompanyDNSZones.ZoneName='' AND
    ->         CompanyDNSZones.ZoneServices LIKE '%HasMail%' OR
    ->         CompanyDNSZones.ZoneServices LIKE '%HasMailingList%';
| ZoneName            |
|       |
| |
2 rows in set (0.01 sec)

How do I get it to only return the item specified in the WHERE clause?

I explictly tell MySQL in my where clause to only return results where
CompanyDNSZones.ZoneName='', so where does it fall out
returning as well?


PS: Just for interest takes, can LEFT / RIGHT / a combination of LEFT &
RIGHT joins be used to cross-reference three or more tables, or is it
limited to 2 tables only?

where clause structuresChris Knipe18 Aug
  • Re: where clause structuresChris Knipe18 Aug
  • where clause structuresTerence19 Aug
  • Re: where clause structuresAleksandar Bradaric19 Aug
    • Re: where clause structuresKeith C. Ivey19 Aug