1)
2)
3)去掉逗号
4)
参考:http://blog.csdn.net/dobear_0922/article/details/2313839
select _size from clothes where measurementNo='M11-031-M1' for xml path('')
2)
select ','+_size from clothes where measurementNo='M11-031-M1' for xml path('')
3)去掉逗号
select stuff((select ','+_size from clothes where measurementNo='M11-031-M1' for xml path('')),1,1,'')
4)
SELECT measurementNo,
sizes= stuff(
(SELECT '/'+_size
FROM clothes c1 //c1不能少
WHERE measurementNo=c2.measurementNo
FOR xml path('')
),1,1,'')
FROM clothes c2
group by measurementNo
参考:http://blog.csdn.net/dobear_0922/article/details/2313839