title: SQL row value as column name
body: <p>I'm pretty experienced in C#, but still mostly a beginner in SQL.<br>
  We have an application in C#, using an MSSQL database.<br>
  One part of our application is simply a list of pre-written queries as reports that the application shows by simply running the query and sticking the returned table into a gridView.
  The user is requesting a new report that I'm not entirely sure is even possible with just SQL and is going to require manipulation of the returned data to get it to look right.</p>
  
  <p>The data that the users want, in the way they want it presented would require me to be able to take this table:</p>
  
  <pre>
  Date&nbsp;&nbsp;Category&nbsp;&nbsp;Count
  ---------------------
  date1&nbsp;Cat1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x1
  date1&nbsp;Cat2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y1
  ...
  date1&nbsp;CatN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z1
  </pre>
  
  <p>gotten from this query:
  <pre><code>select Date, Category, COUNT(*) as 'Count' 
  from Table 
  group by Date, Category</pre></code>
  turned into this table:</p>
  
  <pre>
  Date&nbsp;&nbsp;Cat1&nbsp;&nbsp;Cat2&nbsp;&nbsp;...&nbsp;&nbsp;CatN
  ---------------------------
  date1&nbsp;x1&nbsp;&nbsp;&nbsp;&nbsp;y1&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;&nbsp;z1
  date2&nbsp;x2&nbsp;&nbsp;&nbsp;&nbsp;y2&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;&nbsp;z2
  </pre>
  
  <p>so that I  can join it by date to the other half of the data they want.</p>
  
  <p>Long-winded explanation, short question and followup: is this possible to do, no matter how painfully, with just SQL?<br>
  If so, how?  </p>