Is there any way to use GROUP BY in T-SQL but get "join-list" as a result instead of agregate function? For example:
-- this table
CREATE TABLE tblDATA(
Name int,
GroupName nvarchar(50)
)
-- with this data
INSERT INTO tblDATA VALUES('Peter', 'A')
INSERT INTO tblDATA VALUES('Peter', 'B')
INSERT INTO tblDATA VALUES('Jane', 'A')
INSERT INTO tblDATA VALUES('Jane', 'C')
INSERT INTO tblDATA VALUES('Jane', 'D')
INSERT INTO tblDATA VALUES('Dave', 'B')
INSERT INTO tblDATA VALUES('Susan', 'E')
INSERT INTO tblDATA VALUES('Susan', 'F')
-- and get this query result in the two collumns (I don't care about delimiter) :
Peter A, B
Jane A, C, D
Dave B
Susan E, F