大体语句可以简化如下
select a.d1,(select sum(b.d2),sum(b.d3) from [tbB] as b where b.id=a.id) as c from [tbA] as a where xx=xx select a.d1,(select sum(b.d2),sum
select a.d1,(select sum(b.d2),sum(b.d3) from [tbB] as b where b.id=a.id) as c from [tbA] as a where xx=xx select a.d1,(select sum(b.d2),sum