Group Concat MS SQL
SELECT TOP 1000
T.orderItemId
, STUFF(( SELECT ‘,’+(attribute_name+‘: ‘+attribute_value) FROm qsorderoptions where qsorderoptions.orderItemId =T.orderItemId
FOR XML PATH(”)) , 1 , 1 , ” ) AS Feld
FROM
qsorderoptions As T
–GROUP BY T.product_id
GROUP BY
T.orderItemId
Alternative:
SELECT
T.BemerkungID
,STRING_AGG(thelink,CHAR(13)+CHAR(10)) AS Feld
FROM cte_HTML As T
where thelink not like ‘%download%’
GROUP BY T.BemerkungID