SELECT B.project_zt_code,B.project_gs_name,B.yfgs_name,LEFT(StuList,LEN(StuList)-1) as bs_mon FROM (
SELECT project_zt_code,project_gs_name,yfgs_name,
CONVERT(VARCHAR(4),GETDATE(),120) + '-' + REPLACE((SELECT bs_month+',' FROM DM_YY_design_serve_income_fill b
WHERE b.project_zt_code=A.project_zt_code AND b.project_gs_name=A.project_gs_name and b.yfgs_name = a.yfgs_name
FOR XML PATH('')),
CONVERT(VARCHAR(4),GETDATE(),120)+'-','') AS StuList
FROM DM_YY_design_serve_income_fill A
GROUP BY a.project_zt_code,a.project_gs_name,a.yfgs_name
) B