sqlserver FOR XML PATH 函数用法以及转义字符正常显示

SELECT  *, STUFF(
    (SELECT TOP 2 '_' + value FROM dbo.SplitString(COE,'_') FOR XML PATH ('row'), ROOT('root'), TYPE).value('.', 'NVARCHAR(MAX)'), 
    1, 1, '') FROM dbo.emporg_employee WHERE COE LIKE 'M&C%' 

posted @ 2024-07-12 16:13  暖暖De幸福  阅读(5)  评论(0编辑  收藏  举报