title: Multiply two columns and sum them on inner join
body: <p>I have two tables and I need to get the sum of <code>a.TOTAL * b.QUANTITY</code>.</p>
  
  <p><code>a</code> (<code>A_ID</code>, <code>TOTAL</code>)</p>
  
  <p><code>b</code> (<code>B_ID</code>,  <code>QUANTITY</code>)</p>
  
  <p>So far I wrote:</p>
  
  <pre><code>SELECT a.A_ID, a.TOTAL * b.QUANTITY as calculation
  FROM a INNER JOIN b ON 
  a.A_ID = b.B_ID
  </code></pre>
  
  <p>I tried <code>...SUM(a.TOTAL * b.QUANTITY)</code> as calculation but it doesn't work. I would be grateful for any help!</p>