title: Incorrect syntax near 'FOR'
body: <p>Following code is not working -</p>
  
  <pre><code>SELECT [LY-1], 
         LY = STUFF((SELECT ',' + name FROM temp1 FOR XML PATH ('')), 1,      1, '' ) 
  FROM temp1 
  GROUP BY [LY-1];
  </code></pre>
  
  <p>As it is giving below error-</p>
  
  <blockquote>
    <p>Msg 103010, Level 16, State 1, Line 73
    Parse error at line: 2, column: 36: Incorrect syntax near 'temp1'.</p>
  </blockquote>
  
  <p>Does STUFF and FOR XML are not working Data warehouse ? and is there any alternative for them?</p>