select id,sum(isnull(a.count,0)+isnull(b.count,0)) from a full join b on a.id=b.id
group by a.id,b.id