title: Repeat a sum as a column in SQL
body: <p>I have a table </p>
  
  <pre><code>WO#  Seg# Part# QTY TotSale FlatSale 
  1    1    1     5   35      159
  1    1    2     2   100     159
  1    2    3     3   50      50
  </code></pre>
  
  <p>I need to calculate the FlatSale/SUM(TotSale) for each Seq# &amp; WO# but do not group Seg# into one row.</p>
  
  <p>I need this</p>
  
  <pre><code>WO#  Seg# Part# QTY TotSale FlatSale Calc
  1    1    1     5   35      159      1.177
  1    1    2     2   100     159      1.177
  1    2    3     3   50      50       1
  </code></pre>
  
  <p>With my code I am able to only do the division on each individual line like this:</p>
  
  <pre class="lang-sql prettyprint-override"><code> select *, FlatSale/TotSale as Calc from table
  </code></pre>
  
  <pre><code>WO#  Seg# Part# QTY TotSale FlatSale Calc
  1    1    1     5   35      159      4.54
  1    1    2     2   100     159      1.59
  1    2    3     3   50      50       1
  </code></pre>
  
  <p>I wouldn't mind leaving my Calc column and adding another column if that's the easiest way to do it.</p>