title: SQL Server : performing arithmetic operations on values returned through query
body: <p>I am a SQL noob so looking for some help here. I have an example query like given below. Now I would like to modify the query so that I can perform the following operation on the Test, Test1 and Test2 values in the same query:</p>
  
  <pre><code>OutputValue = Test + Test1 - Test2
  </code></pre>
  
  <p>Then show the result of OutputValue along with Test, Test1 &amp; Test2.</p>
  
  <pre><code>SELECT
      CAST(balancefwd.Shares AS NUMERIC) / 1000 AS Test, 
      SUM(CAST(booksdata.sharesissued AS NUMERIC) / 1000) AS Test1, 
      SUM(CAST(booksdata.sharesretired AS NUMERIC) / 1000) AS Test2
  FROM
      SQLTest.TestBooks.dbo.booksdata booksdata
  JOIN
      SQLTest.TestBooks.dbo.balancefwd balancefwd ON booksdata.companynumber = balancefwd.companynumber
  WHERE
      booksdata.CompanyNumber= '&lt;number&gt;' 
  GROUP BY 
      balancefwd.shares
  </code></pre>
  
  <p>Any suggestions?</p>