title: How to user aggregate function with left join ? mysql
body: <p>I have this query :</p>
  
  <pre><code>SELECT business.bussId, COUNT(invoices.userId) as invoices, COUNT(rating.bussId) as ratingCount ,
         FROM business
         LEFT JOIN invoice ON (invoice.bussId = business.bussId AND invoice.userId = '3000' )
         LEFT JOIN rating ON (rating.bussId = business.bussId )
         WHERE business.bussId=100
  </code></pre>
  
  <p>The COUNT(invoices.userId) user supposed to return the number of rows at invoices tables, where userId = 3000 AND bussId = 100.
  in other words this query:</p>
  
  <pre><code>SELECT COUNT(*) as invoice FROM `invoices` WHERE bussId = '100' AND userId = '30000'.
  </code></pre>
  
  <p>the second query return COUNT (*) = 3 and the first query (when I user LEFT JOIN) it's return 15, How to fix that ?</p>