title: How to make multiple columns based on rows in SQL Server
body: <p>I have a table names Attendance Master </p>
  
  <pre><code>id  ||name ||attn_hours || attn_date
  ---------------------------------------------
  142 || abc || 2.00 || 2013-01-17 00:00:00.000
  142 || abc || 3.00 || 2013-01-18 00:00:00.000
  143 || pqr || 3.00 || 2013-01-17 00:00:00.000
  143 || pqr || 2.00 || 2013-01-18 00:00:00.000
  </code></pre>
  
  <p>I want distinct names and attendance hours in multiple column with column names as attn_date like
  following</p>
  
  <pre><code>id  ||name ||2013-01-17||2013-01-18
  ---------------------------------
  142 || abc || 2.00 || 3.00
  143 || pqr || 3.00 || 2.00
  </code></pre>
  
  <p>Please help</p>
  
  <p>Thanks in advance.</p>