title: SQL: how to create two dimensional pivot table
body: <p>I have the columns for an employee's month sales summary data records</p>
  
  <pre><code>Employee ID  -  Month of Sales   - $ amount
  2                Nov 2013            255 
  2                Aug 2013            314
  15               Jan  2014            86
  </code></pre>
  
  <p>I want the same data, but in two dimensional data table like this</p>
  
  <pre><code>   Employee ID  -   Jan 2013   -     Feb 2013   -     Mar  2013
      2                179               122               567 
      3                255               314               789
      4                271               86                213
  </code></pre>
  
  <p>Right now my current idea to write case statements for each month, such as this</p>
  
  <pre><code> (CASE 
   WHEN MONTH = 'JAN 2013' THEN $ AMOUNT 
   ELSE 0 
   END)
   AS JAN 2013
  </code></pre>
  
  <p>The disadvantage to this is that it is not scalable or flexible (Would have to go back each month to add a new month code, plus, if we change the date-encoding format then this query would have to be entirely re-written). </p>
  
  <p>So I am just wondering if y'all know a better way to do this? </p>