update sysmaterials aa,(select contentcode,sum(hj) as tmp
from bcpcontent
group by contentcode) bb
set aa.price=bb.tmp
where aa.mno=bb.contentcode and aa.hascontent=true
先
update sysmaterials
set aa.price=0
where hascontent=true
再
update sysmaterials aa,bcpcontent bb
set aa.price=aa.price+bb.hj
where aa.mno=bb.contentcode and aa.hascontent=true