SQL Server: how to generate comma separated string for distinct values in aggregated columns in group by statement -
this question has answer here: how use group concatenate strings in sql server? 16 answers i generate comma separated string distinct occurrences aggregated column in group statement. have: select column1, ???statement involving column2??? mytable group column1 i can't figure out put between questions marks. assuming have got following tables: use tsql2012 if object_id('teststackoverflow') not null drop table teststackoverflow create table teststackoverflow( column1 varchar(100) not null, column2 varchar(100) not null, constraint pk2 primary key(column1,column2) ) insert teststackoverflow(column1,column2) values ('value1','t1'), ('value1','t2'), ('value1','t3'), ('value2','t5'), ('value2','t6'), ('v...