title: Getting number of rows with COUNT and WHERE IN with multiple values
body: <p>im trying to query for amount of rows matching all conditions. My query is working like intended only for single value in condition. I wonder if im missing something or whole query should be reworked.</p>
  
  <p>I have tables like (only question related columns):</p>
  
  <pre><code> users:               categories:
  ╔═══════╦═══════════╗╔═══════╦═══════════╗
  ║  id   ║ user_type ║║  id   ║ name      ║
  ╠═══════╬═══════════╣╠═══════╬═══════════╣
  ║ id 1  ║ tutor     ║║ id 1  ║ name1     ║
  ║ id 2  ║ other     ║║ id 2  ║ name2     ║
  ╚═══════╩═══════════╝╚═══════╩═══════════╝
  ads:
  ╔════════════╦══════════════╗
  ║ creator_id ║ category_id  ║
  ╠════════════╬══════════════╣
  ║ user.id1   ║ category.id1 ║
  ║ user.id2   ║ category.id2 ║
  ╚════════════╩══════════════╝
  </code></pre>
  
  <p>And query:</p>
  
  <pre><code>SELECT COUNT(DISTINCT users.id) AS count FROM users
  INNER JOIN ratings
  ON users.id = receiver_id
  LEFT JOIN ads
  ON users.id = ads.creator_id
  LEFT JOIN categories
  ON categories.id = ads.category_id
  WHERE user_type = "tutor"
  AND categories.name IN ("economy","anatomy")
  </code></pre>
  
  <p>What i get:</p>
  
  <blockquote>
    <p><strong>count = 13</strong> (which is number of matching rows for "economy" (10) + rows for "anatomy" (5) - rows matching both conditions (2), <strong>10 + 5 - 2 = 13</strong>)</p>
  </blockquote>
  
  <p>For single value in condition, ex:</p>
  
  <p><code>AND categories.name IN ("economy")</code></p>
  
  <p>im getting proper outcome</p>
  
  <p>What i need:</p>
  
  <blockquote>
    <p><strong>count = 2</strong> (which is total number of rows that match all conditions)</p>
  </blockquote>