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