title: Pivot table in SQL (column results to rows)
body: <p>how do I pivot a results query?</p>
  
  <p>currently it looks like this</p>
  
  <pre><code>Hours | Volume
  8     | 1000
  9     | 1012 
  10    | 1045
  11    | 1598
  12    | 1145
  13    | 1147
  </code></pre>
  
  <p>into this</p>
  
  <pre><code>8   |9   |10  |11  |12  |13
  1000|1012|1045|1598|1145|1147
  </code></pre>
  
  <p>I tried the following but its not working</p>
  
  <pre><code>Select #TEMP.volume,
         pvt.volume,
            #TEMP.volume
            pvt.volume
  FROM #TEMP
  PIVOT (volume FOR [DialHour] IN ( "8", "9", "10", "11","12","13","14","15","16","17","18","19")) AS pvt
  </code></pre>