title: MySQL - WHERE/AND with pivot table
body: <p>I have 3 tables:</p>
  
  <p><strong>CLINICS</strong></p>
  
  <pre><code>id | name | description | lat | lng | opening_hours| logo | address | city | zip | phone_number | email | url | gmaps_link | marker | created_at | updated_at
  </code></pre>
  
  <p><strong>SERVICES</strong></p>
  
  <pre><code>id | name | created_at | updated_at
  </code></pre>
  
  <p><strong>CLINIC_SERVICES</strong></p>
  
  <pre><code>clinic_id | service_id
  </code></pre>
  
  <p>This query should return two results, but at the moment it is returning 0:</p>
  
  <pre><code>SELECT * FROM
          (SELECT clinics.id as cid, clinics.lat, clinics.lng, clinics.opening_hours,
          clinics.logo, clinics.address, clinics.city, clinics.name, clinics.description,
          clinics.zip, clinics.phone_number, clinics.email, clinics.url, clinics.gmaps_link,
          clinics.marker,
          countries.full_name AS country,
          (6378 * acos(
              cos(radians(-33.84801)) * cos(radians(lat)) *
              cos(radians(lng) - radians(151.06488)) +
              sin(radians(-33.84801)) * sin(radians(lat))))
          AS distance
          FROM clinics
          JOIN countries ON countries.id = clinics.country_id
          LEFT JOIN clinics_services ON clinics.id = clinics_services.clinic_id
           WHERE clinics_services.service_id = 1 AND clinics_services.service_id = 29
          GROUP BY clinics.id
          ) AS distances
      WHERE distance &lt; 50000
      ORDER BY distance ASC
  </code></pre>
  
  <p>If I put <strong>OR</strong> instead of <strong>AND</strong> I am getting 5 clinics, which actually works as I think should work. How can I get proper result (clinic have both services)? What am I doing wrong here?</p>