sql server - SQL rollup colum values into 1 concatonated value -


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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -