title: Total running on dynamics columns
body: <p>I have a table that looks something like the following :</p>
  
  <pre><code>          W1  W2 w3
  Gold      10    2    3              
  Silver     3    1    1
  </code></pre>
  
  <p>but i need a result :</p>
  
  <pre><code>          W1  W2  w3
  Gold      10  12  15            
  Silver     3  4  5
  </code></pre>
  
  <p>Is there any way i can get that result?</p>
  
  <p>My sql query : </p>
  
  <pre><code>SELECT  
     week1=[1],week2=[2],week3=[3]
  FROM
  (
      SELECT
      [week]=DATEPART(ISO_WEEK,ta.enddate),ta.price
      FROM
      table1 ta where ta.enddate BETWEEN '2016/01/01' AND '2016/12/31'
  ) src
  PIVOT
  (
      SUM(price) FOR week IN ( 
          [1],[2],[3])
  ) piv
  </code></pre>