update tb_a inner joib tb_c
on tb_a.country_id=tb_c.country_id
and tb_c.province_id=old.province_id
set tb_a.country_GDP=tb_acountry_GDP-old.province_GDP+new.province_GDP
update tb_a,tb_c
set tb_a.country_GDP=tb_acountry_GDP-old.province_GDP+new.province_GDP
where tb_a.country_id=tb_c.country_id
and tb_c.province_id=old.province_id
不想用子查询,有好办法的留言结贴
tb_b中的触发器(用子查询)
begin
update tb_a set country_GDP=country_GDP-old.province_GDP+new.province_GDP where country_id=(select country_id from tb_c where province_id=old.province_id)
end