select a1.字段bb,b1.sum_ww ,b1.sum_xx,b1.sum_yy
from 表A a1,
(select 字段aa,sum(字段ww) as sum_ww,sum(字段xx) as sum_xx,sum(字段yy) as sum_yy
from 表B
where 字段kk=范围
group by 字段aa) b1where a1.字段aa=b1.字段aa
from 表A a1,
(select 字段aa,sum(字段ww) as sum_ww,sum(字段xx) as sum_xx,sum(字段yy) as sum_yy
from 表B
where 字段kk=范围
group by 字段aa) b1where a1.字段aa=b1.字段aa
where a1.字段aa=b1.字段aa
---->
where a1.字段aa(+)=b1.字段aa