sql server - SQL rollup colum values into 1 concatonated value -
this question has answer here:
what kind of sql needed group groupid , concatonate of name values 1 row comma's separating values?
so this:
groupname groupid name screens 139091 business screens 139091 business screens 139091 cafeteria/bathrooms screens 139091 lobby
would become this:
groupname groupid name screens 139091 business, cafeteria/bathrooms, lobby
this need done on many groupid's there in table , guessing skip duplicates. better done on c# side? sql version 2008 r2
group_concat not exist use in sql server
hope out.
select groupname, groupid , stuff(( select ',' + name #tab xml path('')),1,1,'') #tab group groupname, groupid
Comments
Post a Comment