title: sql sum data from multiple tables
body: <p>I have 2 tables AP and INV where both have the columns [PROJECT] and [Value].</p>
  
  <p>I want a query to return something like this :</p>
  
  <p>PROJECT | SUM_AP | SUM_INV</p>
  
  <p>I came up with the code below but it's returning the wrong results ( sum is wrong ).</p>
  
  <pre><code>SELECT AP.[PROJECT],
  SUM(AP.Value) AS SUM_AP, 
  SUM(INV.Value) AS SUM_INV
  FROM AP INNER JOIN INV ON (AP.[PROJECT] =INV.[PROJECT])
  WHERE AP.[PROJECT] = 'XXXXX'
  GROUP BY AP.[PROJECT]
  </code></pre>