
其中:oracle 自帶 wmsys.wm_concat(需要合並的字段)

Mysql 自帶(group_concat)
Sql Server(---------)
select p.KeyId,
stuff((SELECT ',' + CONVERT(nvarchar, KeyId) FROM dbo.QR_Inspection WHERE propertyId = p.KeyId FOR xml path('')),1,1,'') AS iid,
stuff((SELECT ',' + CONVERT(nvarchar, KeyId) FROM dbo.QR_User WHERE propertyId = p.number FOR xml path('')),1,1,'') AS uid
from dbo.QR_Property p
order by KeyId desc
https://blog.csdn.net/lchq1995/article/details/86615119 (還有類似問題,可以借鑒下 )
