SQLServer 将多行数据,合并成一条
select Name ,Sex ,Age ,IDCardNo ,Tel , stuff((select ','+ Remark from #Temp
where a.RegID=RegID
for xml path('')),1,1,'') as 您的体质
from #Temp a
group by a.RegID,Name,Sex,Age,IDCardNo,Tel
宝剑锋从磨砺出,
梅花香自苦寒来。
雪压枝头低,虽低不着泥。一朝红日出,依旧与天齐。
select Name ,Sex ,Age ,IDCardNo ,Tel , stuff((select ','+ Remark from #Temp
where a.RegID=RegID
for xml path('')),1,1,'') as 您的体质
from #Temp a
group by a.RegID,Name,Sex,Age,IDCardNo,Tel