select a.xm,a.xb,b.hz from tbl_test a,(select sum(aa) hz,id from tb1_b group by id) b where a.id=b.id;