insett into tab2
select workitem,max(tab1.note),sum(money) from
tab2 left outer join tab1 on tab2.workitem=tab1.workitem
left outer join tab3 on tab2.workitem=tab3.workitem
group by tab3.workitem
select workitem,max(tab1.note),sum(money) from
tab2 left outer join tab1 on tab2.workitem=tab1.workitem
left outer join tab3 on tab2.workitem=tab3.workitem
group by tab3.workitem
insert into tab2 select a.workitem,sum(money),a.note from tab1 a,tab3 b where a.workitem=b.workitem group by b.workitem