TSQL – Concatenate Rows using FOR XML PATH() | Sql And Me

TSQL – Concatenate Rows using FOR XML PATH() | Sql And Me

瀏覽:1028
日期:2025-09-28
I tried this and still get the results as rows and no string at all SELECT CAT.user_id AS [Category], STUFF(( SELECT ‘,’ + SUB.role_Name AS [text()] — Add a comma (,) before each value FROM role SUB WHERE SUB.role_id = CAT.role_id FOR XML ......看更多