DECLARE @Table Table (Id int Not NULL identity(1,1), Wert nvarchar(10)) Insert into @Table Values('A'),('B'),('C') Select * from @Table Select STRING_AGG(Wert,', ') WITHIN GROUP ( ORDER BY Wert ASC) as Liste from @Table
Gedanken zu SQL, Reports, ETL und CRM
DECLARE @Table Table (Id int Not NULL identity(1,1), Wert nvarchar(10)) Insert into @Table Values('A'),('B'),('C') Select * from @Table Select STRING_AGG(Wert,', ') WITHIN GROUP ( ORDER BY Wert ASC) as Liste from @Table