title: How to Join mysql Tables With Sum
body: <p>How can i join the following SQL query?</p>
  <pre><code>SELECT SUM( payments.amount ) , SUM( payments.balance ) , records.recordID, records.record
  FROM fees AS payments
  INNER JOIN recordtype AS records ON payments.referenceID = records.recordID
  </code></pre>
  <p>the above query is giving the following error</p>
  <blockquote>
  <p>MySQL said: Documentation</p>
  <h1>1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause</h1>
  </blockquote>
  <p>My Expectation results would like each recordID to show balance and amount it has.</p>
  <p>Thank and Regards, all Suggestions &amp; Questions are welcome</p>