I have this code:
DECLARE @MyTable AS TABLE
(
[Month] INT,
Salary INT
);
INSERT INTO @MyTable VALUES (1,2000), (1,3100);
SELECT [Month], Salary FROM @MyTable;
Output:
I want to concat the Salary (grouping by month) so that it will be NVARCHAR
like this: '2000,3100'
How would I do this efficiently?