title: Not getting proper result after connecting 4 tables in MySQL
body: <p>I am Working on Invoice and Payment Where I have 4 tables :</p>
  
  <pre><code>1. Client (Client Data i.e client_id, client_name)
  2. Invoice (Invoice Data i.e invoice_no, client_id, invoice_date)
  3. Invoice Data (invoice_no, product_name, qty, rate, tax)
  4. Payment (Payment Data i.e invoice_no, paid_value, date)
  </code></pre>
  
  <p>I am connecting these tables but I am not getting the proper result. Below is the MySQL Statement:</p>
  
  <pre><code>SELECT invoices.invoice_no, clients.company_name,
  SUM((((invoices_data.qty * invoices_data.rate) * (invoices_data.cgst + invoices_data.sgst + invoices_data.igst))/100) + (invoices_data.qty * invoices_data.rate)) AS invoice_value,
  SUM(payments.value) AS paid_value
  FROM invoices
  INNER JOIN clients ON invoices.client_id = clients.id
  INNER JOIN invoices_data ON invoices.invoice_no = invoices_data.invoice_no
  LEFT JOIN payments ON payments.invoice_no = invoices.invoice_no
  GROUP BY invoices.invoice_no
  </code></pre>
  
  <p>Result what i am getting : </p>
  
  <p></p>
  
  <pre><code>invoice_no | company_name | invoice_value | paid_value
  -------------------------------------------------------
  INVML1     | RX Companies | 92978.1       | 6400
  -------------------------------------------------------
  INVML2     | Demo Client  | 2540          | NULL
  </code></pre>
  
  <p>The Above Result is Incorrect, The Total Invoice Value is 30992.7 and paid value is 3200.
  Please help me to solve this problem</p>