SELECT items,
value = stuff
((SELECT ',' + color
FROM myshangpin AS t
WHERE t .items = myshangpin.items FOR xml path('')), 1, 1, '')
FROM myshangpin
GROUP BY items
SELECT B.items,LEFT(StuList,LEN(StuList)-1) as color FROM (
SELECT items,
(SELECT color+',' FROM myshangpin
WHERE items=A.items
FOR XML PATH('')) AS StuList
FROM myshangpin A
GROUP BY items
) B