title: How to sum or group by text in sql
body: <p>I'm using the SQL 2008 R2.</p>
  
  <p>Here is my sample:</p>
  
  <pre><code>Class  Name1   Quantity1  Name2   Quantity2  Name3   Quantity3
  AAA    Jane      6         ''        ''       ''       ''
  AAA     ''       ''        Jim        12      ''       ''
  AAA     ''       ''        ''        ''       Hons      2
  </code></pre>
  
  <p>How could I select data so that I have the result like that:</p>
  
  <pre><code>Class  Name1   Quantity1  Name2   Quantity2  Name3   Quantity3
  AAA    Jane      6         Jim        12      Hons      2
  </code></pre>
  
  <p>Please advise.</p>
  
  <p>Thanks.</p>