title: T-SQL PIVOT data from long form to wide by a date
body: <p>I want to pivot my data from long to wide using t-sql pivot function if possible. My current table looks like:</p>
  
  <pre><code>ID  DATE        NUM VALUE
  1   2005-01-20  29  197
  1   2005-01-20  28  58
  1   2005-01-20  30  90
  1   2005-02-08  29  210
  1   2005-02-08  30  133
  1   2005-02-08  28  67
  2   2005-01-10  28  87
  2   2005-01-10  30  119
  2   2005-07-11  28  77
  2   2005-07-11  29  174
  </code></pre>
  
  <p>Output should look like this:</p>
  
  <pre><code>ID  DATE        V28 V29  V30
  1   2005-01-20  58  197  90
  1   2005-02-08  67  210  133
  2   2005-01-10  87  NULL 119
  2   2005-07-11  77  74   NULL
  </code></pre>