title: Group by clause is not giving me desired result in Sql Server
body: <p>I want the sum of pcurrentbalance and ptotal amount from my this query. But when I add these two columns in my group by clause then it didn't show me desired result. Please what is wrong in this query </p>
  
  <pre><code>select  
     a.userid, a.UserNM, a.UserPMobileNo,
     (b.pCurrentBalance + b.pTotalAmt) as [OB] 
  into #OB 
  from   
       #user a 
  left join  
       tbProcTransactions b on a.userid = b.puserid 
  group by 
       a.userid, a.UserNM, a.UserPMobileNo, pCurrentBalance, pTotalAmt
  </code></pre>
  
  <p>I am getting result for every user </p>
  
  <pre><code>userid  UserNM  UserPMobileNo   OB
  5   API_Ezy_User    9815765543  118740
  5   API_Ezy_User    9815765543  118793
  5   API_Ezy_User    9815765543  118849
  5   API_Ezy_User    9815765543  118968
  5   API_Ezy_User    9815765543  118987
  5   API_Ezy_User    9815765543  119072
  5   API_Ezy_User    9815765543  119098
  5   API_Ezy_User    9815765543  119217
  5   API_Ezy_User    9815765543  119198
  5   API_Ezy_User    9815765543  119360
  </code></pre>