SELECT 字段1, [列名] = stuff(( SELECT ',' + [字段2] FROM aa t WHERE t.字段1 = aa.字段1 FOR xml path('')) , 1 , 1 , '') FROM aa GROUP BY 字段1