title: What is the difference between these two queries? Why different results?
body: <p><strong>This</strong> - gives incorrect values for <code>total_classes</code></p>
  
  <pre><code>SELECT IFNULL(count(wc.id_wc),0) AS total_classes
  
  FROM `all_tag_relations` AS a
      LEFT JOIN (tags AS t, WebClasses as wc) 
      ON ( a.id_tag = t.id_tag AND a.id_tutor = wc.id_author )
  GROUP BY a.id_tutor
  </code></pre>
  
  <p><strong>But this one</strong> - with a subquery gives correct values - </p>
  
  <pre><code>SELECT (SELECT IFNULL(count(wc.id_wc),0) FROM WebClasses as wc WHERE wc.id_author = a.id_tutor) AS total_classes
  
  
  FROM `all_tag_relations` AS a
       LEFT JOIN (tags AS t) ON ( a.id_tag = t.id_tag) 
  group by a.id_tutor
  </code></pre>
  
  <p><strong>Solution</strong>
  The solution is to join the other tables with the actual Tutors table with All_Tag_relations like this</p>
  
  <pre><code>...FROM Tutors as td on join All_Tag_Relations as a on td.id_tutor=a.id_tutor LEFT JOIN ...
  </code></pre>