title: Convert multiple Rows into Columns
body: <p>I have a table from my script SQL e.g.:</p>
  
  <p><img src="https://i.stack.imgur.com/6JwII.png" alt="enter image description here"></p>
  
  <p>I need to convert this table into:</p>
  
  <p><img src="https://i.stack.imgur.com/KBr8e.png" alt="enter image description here"></p>
  
  <p>I create temporary table:</p>
  
  <pre><code>CREATE TABLE #Table
  (
    Data Date,
    Max Real,
    Min Real,
    Avg Real
  )
  </code></pre>
  
  <p>I have a script, when my values are calculated and next:</p>
  
  <pre><code>INSERT INTO #Table (Data, Max, Min, Avg) VALUES (@Data, @Max, @Min, @Avg)
  </code></pre>
  
  <p>I don't know, how to convert <code>table1</code> into <code>table2</code></p>