List:General Discussion« Previous MessageNext Message »
From:Aleksandar Bradaric Date:August 19 2002 7:36am
Subject:Re: where clause structures
View as plain text  
Hi,

->   WHERE CompanyDetails.CompanySuspended='0' AND
->         CompanyDNSZones.ZoneName='megalan.co.za' AND
->         CompanyDNSZones.ZoneServices LIKE '%HasMail%' OR
->         CompanyDNSZones.ZoneServices LIKE '%HasMailingList%';

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

It's that OR that makes the mess. Try with:

->   WHERE CompanyDetails.CompanySuspended='0' AND
->         CompanyDNSZones.ZoneName='megalan.co.za' AND
->         (CompanyDNSZones.ZoneServices LIKE '%HasMail%' OR
->          CompanyDNSZones.ZoneServices LIKE '%HasMailingList%');


Regards,
Sasa

»mysql, select, database«


Thread
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