title: MYSQL ignoring WHERE
body: <p>I cannot seem to figure out why my AND statements in the WHERE are being ignored? </p>
  
  <p>MYSQL query</p>
  
  <pre><code>SELECT
      HomeStatus.Completed
  FROM HomeInfo
      LEFT JOIN HomeSubdivision ON HomeSubdivision.HomeSubdivisionID = HomeInfo.SubdivisionID
      LEFT JOIN HomeSection ON HomeSection.HomeSectionID = HomeInfo.SectionID
      LEFT JOIN HomeStatus ON HomeStatus.HomeStatusID = HomeInfo.HomeStatusID
  WHERE TRIM(CONCAT(IFNULL(TRIM(HomeInfo.HomeNumber), ''),  " ", IFNULL(TRIM(HomeInfo.HomeStreet), ''),  " ", IFNULL(TRIM(HomeInfo.HomeStreetType), ''),  " ", IFNULL(TRIM(HomeInfo.HomeStreetUnit), ''))) LIKE '%lake%' OR HomeSubdivision.SubdivisionName LIKE '%lake%'
      AND HomeStatus.Completed = 0
      AND HomeStatus.Reference = 0
      AND HomeStatus.Cancel = 0
  GROUP BY SectionName
  ORDER BY SubdivisionName, LENGTH(SectionName), SectionName ASC
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>Completed
  1
  1
  1
  1
  0
  1
  0
  </code></pre>