In sql 2017 kunt u de STRING_AGG-functie gebruiken:
SELECT STRING_AGG(T.val, ',') AS val
, T.grp
FROM @tbl AS T
GROUP BY T.grp
In sql 2017 kunt u de STRING_AGG-functie gebruiken:
SELECT STRING_AGG(T.val, ',') AS val
, T.grp
FROM @tbl AS T
GROUP BY T.grp