title: Inner join summing up all rows instead of 1
body: <p>I have 2 tables, one which contains Revenue data and one which contains Account data - the account data contains multiple rows per account ... the Revenue value assigned against FactPlanNo 327865 is $65,000 which is what I want to show, however because there are 4 rows in the RefGPNRoleMapping table for this account, it is multiplying $65,000 by 4</p>
  
  <p>How do I stop this from happening so it brings back the following result:</p>
  
  <pre><code>    AccountNumber     AccountName       Rev
      0123456           MyAccount         65000 (instead of 260,000)
  </code></pre>
  
  <p>I currently have this query:</p>
  
  <pre><code>   select
     b.AccountNumber,
     b.AccountName,
     sum(a.Revenue) as rev
     from mdfl.FactPlanNo a
     inner join xyz.RefGPNRoleMapping b on
     a.FactPlanNo = b.FactPlanNo
     where b.FactPlanNo = '327865'
     group by b.AccountNumber, b.AccountName
  </code></pre>