title: Dynamic pivot table sql server 2008
body: <p>I would like to do data mining. But my data is not useful.
  my table structure is something like:</p>
  
  <pre><code>date            customerid     age   residence   prosubsclassid   productid       
  ----------------------------------------------------------------------------
  21.11.2001       123232323      a         b          2099         23232322 
  
  
  amount   asset    sales
  ------------------------
  4        34       56
  </code></pre>
  
  <p>Now I have to show the data in this way:</p>
  
  <pre><code>prosubsclassid     130207   130208  130209      
                     ------   ------  ------  
  1413232              1        3       1     
  3435545              2        1       2      
  3534344                       3       1      sum(amount)
  Column(customerid)    
  </code></pre>
  
  <p>I want to convert to tabular form in my data.</p>