I sql 2017 kan du använda funktionen STRING_AGG:
SELECT STRING_AGG(T.val, ',') AS val
, T.grp
FROM @tbl AS T
GROUP BY T.grp
I sql 2017 kan du använda funktionen STRING_AGG:
SELECT STRING_AGG(T.val, ',') AS val
, T.grp
FROM @tbl AS T
GROUP BY T.grp