title: MySQL Join 4 tables shows wrong sum
body: <p>I have rewriten my request. Sorry fot not being specific. You can find the fiddle here: <a href="http://sqlfiddle.com/#!9/b1cbf1/2" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/b1cbf1/2</a></p>
  
  <p>I want to output:</p>
  
  <pre><code># invoice 1 - customer 1, items total:500, quantity:5, paid 250
  # invoice 2 - customer 1, items total: 360, quantity:4, paid 300
  # invoice 3 - customer 2, items total - 650, quantity: 5, paid 300
  # invoice 4 - customer 3, items total - 210, quantity: 2, paid 110
  # invoice 5 - customer 3, items total - 0, quantity: 0, paid 0
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>SELECT 
      invoices.invoice_id,
      customers.last_name,
      COUNT(items.item_invoice_id) as quantity,
      SUM(payments.payment_amount) as total_paid,
      SUM(items.item_price) as subtotal
  
  FROM `invoices` 
  LEFT JOIN payments
       ON payments.invoice_id = invoices.invoice_id
  LEFT JOIN customers
        ON customers.id = invoices.invoice_customer_id
  
  LEFT JOIN items
         ON items.item_invoice_id = invoices.invoice_id
  
  GROUP BY invoices.invoice_id
  </code></pre>