一张表关联多张表,多张表数据“,”隔开赋值
SELECT MeetingSn ,
STUFF(( SELECT ',' + ProductName
FROM MeetingProduct t
WHERE MeetingSn = msp.MeetingSn
FOR
XML PATH('')
), 1, 1, '') AS ProductName
FROM dbo.MeetingProduct msp
WHERE IsDeleted = 0
GROUP BY MeetingSn