title: Taking count from multiple tables using left join
body: <p>I am using the following query to get the count from multiple tables:-</p>
  
  <pre><code>SELECT 
    b.sales_title,
    c.cat_name,
    count(b.sales_id) as cnt,
    count(e.comment_id) as coun  
  FROM tb_sale_report a 
    inner join tbl_sales    b on a.sales_id=b.sales_id 
    inner join  tb_category c on c.cat_id=b.category_id 
    left  join tb_comment   e on b.sales_id=e.sales_id
  GROUP BY b.sales_title
  </code></pre>
  
  <p>I am trying to achieve</p>
  
  <pre><code>sales_title |   cat_name    |   cnt  |  coun
  --------------------------------------------------
  Affiliate   |   Kids toys   |   8    |  0
  Date Check  |   Handbags    |   26   |  1
  Date Date   |   My Category |   4    |  1
  Future Date |   Handbags    |   3    |  0
  Giovanni    |   Kids toys   |   4    |  1
  </code></pre>
  
  <p>But instead of that i am getting the wrong count, the values for the column <code>coun</code> is getting wrong like this,</p>
  
  <pre><code>sales_title  |  cat_name    |   cnt  |  coun
  ---------------------------------------------
  Affiliate    |  Kids toys   |   8    |  0
  Date Check   |  Handbags    |   26   |  26
  Date Date    |  My Category |   4    |  4
  Future Date  |  Handbags    |   3    |  0
  Giovanni     |  Kids toys   |   4    |  4
  </code></pre>
  
  <p>How can i write the query to achieve my goal.Need help, i am a newbie to programming.Thanks in advance</p>