Group Concat MS SQL
SELECT
T.orderItemId
, STUFF(( SELECT ‘,’+(attribute_name+’: ‘+attribute_value) FROm
Test_Staging.dbo.qtorderoptions where qtorderoptions.orderItemId =T.orderItemId
FOR XML PATH(”)) , 1 , 1 , ” ) AS Feld
FROM
Test_Staging.dbo.qtorderoptions As T
GROUP BY
T.orderItemId
rückwärts Auflösen von Strings:
SELECT
[P_id] AS Salesproductgroupid,
[P_configurator.attributes_displayName] AS Attribute,
[P_configurator.attributes_possibleValues_attributeValueIds] =value
FROM FRISCO_Salesproduct_ShopAttribute
CROSS APPLY string_split ([P_configurator.attributes_possibleValues_attributeValueIds],’,’)