title: mysql several count and join returns strange value
body: <p>I'm trying to make a count within several table with <code>JOIN</code>, but when I made several <code>JOIN</code>s the <code>COUNT</code>s got wrongly counted.</p>
  
  <p>Basically I've got 4 tables, named:</p>
  
  <ol>
  <li>predective_search</li>
  <li>predective_to_product</li>
  <li>predective_to_category</li>
  <li>predective_to_manufacturer</li>
  </ol>
  
  <p>I want to count the total number of products, categories and manufacturer which has same id in table predective_search.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>SELECT * , 
      COUNT(pp.predictive_id) AS total_products, 
      COUNT(pc.predictive_id) AS total_categories, 
      COUNT(pm.predictive_id) AS total_manufacturers 
  FROM predictive_search ps 
  LEFT JOIN predictive_to_product pp ON (ps.predictive_id = pp.predictive_id) 
  LEFT JOIN predictive_to_category pu ON (ps.predictive_id = pc.predictive_id) 
  LEFT JOIN oc_predictive_to_manufacturer pm ON (ps.predictive_id = pm.predictive_id)    
  GROUP BY ps.predictive_id
  </code></pre>
  
  <p>Also the <code>GROUP BY</code> is needed I think. I'm stuck at this as I'm not getting any way to do this</p>