title: SQL: Calculate Percentage in new column using another column
body: <p>I found it hard to describe what I wanted to do in the title, but I will be more specific here.
  I have a reasonably long query:</p>
  
  <pre><code> SELECT 
  
      /*Amount earned with validation to remove outlying figures*/
  
      Case When SUM(t2.[ActualSalesValue])&gt;=0.01 OR SUM(t2.[ActualSalesValue])&lt;0 Then SUM(t2.[ActualSalesValue]) ELSE 0 END AS 'Amount', 
  
      /*Profit earned (is already calculated then input into db, this just pulls that figure*/
  
      SUM(t2.[Profit]) AS 'Profit', 
  
      /*Product Type - pulls the product type so that we can sort by product*/
  
      t1.[ucIIProductType] AS 'Product Type', 
  
      /*Profit Percentage - This is to calculate the percentage of profit based on the sales price which uses 2 different columns - Case ensures that there are no wild values appearing in the reports as previously experienced*/
  
      Case When SUM(t2.[ActualSalesValue])&gt;=0.01 OR SUM(t2.[ActualSalesValue])&lt;0 THEN (SUM(t2.[Profit])/SUM(t2.[ActualSalesValue])) ELSE 0 END AS 'Profit Percentage',
  
  /*Percentage of Turnover*/
      *SUM(t2.[ActualSalesValue])/(Select SUM(t2.[ActualSalesValue]) OVER() FROM [_bvSTTransactionsFull]) AS 'PoT'
  
      /*The join is connect the product type with the profit and the amount*/
  
      FROM  [dbo].[StkItem] AS t1
      INNER JOIN [dbo].[_bvSTTransactionsFull] AS t2
  
      /*There attirbutes are the links between the tables*/
      ON t1.[StockLink]=t2.[AccountLink]
  
      WHERE t2.[TxDate] BETWEEN '1/Aug/2014' AND '31/Aug/2014' AND ISNUMERIC(t2.[Account]) = 1
  
      Group By t1.[ucIIProductType]
  </code></pre>
  
  <p>The 'Percentage of Turnover' part I am having trouble with - I am trying to calculate the percentage of the Amount based on the total amount - using the same column. So eg: I want to take the Amount value in row 1, then divide it by the total amount of the entire column and then have that value listed in a new column.  But I keep getting errors or I Keep getting 1 (because it wants to divide the value by the same value. CAN anyone please advise me on proper syntax for solving this:</p>
  
  <pre><code>/*Percentage of Turnover*/
          *SUM(t2.[ActualSalesValue])/(Select SUM(t2.[ActualSalesValue]) OVER() FROM [_bvSTTransactionsFull]) AS 'PoT'
  </code></pre>