SQL 多行合为1行

STUFF(( SELECT DISTINCT
'<br>' + dev.SerialNumber
FROM Upgrade_Device upDev
JOIN Device dev ON dev.RecordID = upDev.DeviceID
WHERE a.RecordID = upDev.UpgradeRecord
FOR
XML PATH('')
), 1, 1, '') AS SerialNumber

posted @ 2020-06-15 09:39  十年之前,十年之后  阅读(6)  评论(0编辑  收藏  举报