title: What is the meaning of SELECT ... FOR XML PATH(' '),1,1)?
body: <p>I am learning sql in one of the <a href="https://stackoverflow.com/questions/21604129/how-to-get-the-values-of-column-in-sql-comma-seprated/21604634#21604634">question</a> <a href="http://social.msdn.microsoft.com/Forums/sqlserver/en-US/d4bc611f-0951-4ed6-9634-c204b2304f92/stuff-and-for-xml-path" rel="noreferrer">and here</a> I saw usage of this,can some body make me understand what xml path('') mean in sql? and yes,i browsed through web pages I didn't understand it quite well!</p>
  
  <p>I am not getting the Stuff behind,now what does this piece of code do ?(only <code>select</code> part)</p>
  
  <pre><code>declare @t table
  (
      Id int,
      Name varchar(10)
  )
  insert into @t
  select 1,'a' union all
  select 1,'b' union all
  select 2,'c' union all
  select 2,'d' 
  
  select ID,
  stuff(
  (
      select ','+ [Name] from @t where Id = t.Id for XML path('')
  ),1,1,'') 
  from (select distinct ID from @t )t
  </code></pre>