I have this query in SQL Server 2012 :
select
tblplantitle.id, tblplantoproductpayment.productid
from
tblplantitle
inner join
tblplan on tblplan.plantitleid = tblplantitle.id
inner join
tblplantoproductpayment on tblplantoproductpayment.planid = tblplan.id
group by
tblplantitle.id, tblplantoproductpayment.productid
结果如下:
id productid
1 1
1 2
1 3
1 10
2 5
2 1
3 4
3 11
但我希望得到这个结果:
1 1,2,3,10
2 5,1
3 4,11
我该如何获得那个结果?