title: Concatenating Rows from a table
body: <p>In SQL Server, I'm using STUFF, XML functionality to use this feature of concatenating strings. After the process i have to update the last element of the record.</p>
  
  <p>My table looks like this:</p>
  
  <pre><code>id   category
  -------------
  1      Pop
  1      Rock
  2      Pop
  3      Rock
  </code></pre>
  
  <p>Same ID category should get append with <code>|</code> delimiter</p>
  
  <pre><code>Pop|Rock| as Pop|Rock
  </code></pre>
  
  <p>This is the way I'm trying to do. But the <code>Stuff</code> and XML is killing my performance.</p>
  
  <p>Any help would be appreciated.</p>