Comments on: Concatenating Data From Different Rows into Single Column Row https://sqlserverlearner.com/2012/08/03/concatenating-data-from-different-rows-into-single-column-row/ LEARN SQL SERVER ONLINE Wed, 16 Jul 2014 06:10:37 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Mad Computerist https://sqlserverlearner.com/2012/08/03/concatenating-data-from-different-rows-into-single-column-row/comment-page-1/#comment-2024 Wed, 16 Jul 2014 06:10:37 +0000 https://sqlserverlearner.azurewebsites.net/2012/08/03/concatenating-data-from-different-rows-into-single-column-row/#comment-2024 Thanks Abhijit,

Your code works perfectly.

]]>
By: Abhijit https://sqlserverlearner.com/2012/08/03/concatenating-data-from-different-rows-into-single-column-row/comment-page-1/#comment-2023 Fri, 24 Aug 2012 07:18:54 +0000 https://sqlserverlearner.azurewebsites.net/2012/08/03/concatenating-data-from-different-rows-into-single-column-row/#comment-2023 Hello Devi,
Nicely explained! we can also remove the xml attributes and get clean resultset using SUBSTRING function

–Sol5:

SELECTa.GroupName, SUBSTRING(
(SELECT’,’ + b.MemberName
FROMGroupMembers b
WHEREa.GroupName= b.GroupName
FOR XML PATH(”)
), 2, 10000000000)
FROMGroupMembers a
GROUP BY a.GroupName

]]>