title: Merge multiple rows into one column using carriage return line feeds
body: <p>The code below (which I got from <a href="https://stackoverflow.com/questions/12645297/merge-multiple-rows-into-one-column-without-duplicates/12645346?noredirect=1#comment22037856_12645346">here</a> ) does a good job at merging together multiple fields separating them with commas.</p>
  
  <pre><code>select player,
    stuff((SELECT distinct ', ' + cast(score as varchar(10))
         FROM yourtable t2
         where t2.player = t1.player
         FOR XML PATH('')),1,1,'') 
  from yourtable t1
  group by player
  </code></pre>
  
  <p>I need to replace the commas with carriage return line feeds. I tried the code below but it started separating the entries with these characters: "#x0D;"</p>
  
  <pre><code>select player,
    stuff((SELECT distinct CHAR(13)+CHAR(10) + cast(score as varchar(10))
         FROM yourtable t2
         where t2.player = t1.player
         FOR XML PATH('')),1,1,'') 
  from yourtable t1
  group by player
  </code></pre>
  
  <p>I suspect the problem is with the "FOR XML PATH('')),1,1,''" but I don't know what values to put.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thanks!</p>