MySQL Forums
Forum List  »  Triggers

Re: trigger new row join other table
Posted by: Peter Brawley
Date: January 08, 2014 03:50PM

Something like this?

create trigger after update on b for each row
begin
  set @ctry = (select country_id from c where province_id=OLD.province_id );
  update a 
    set country_gdp = country_gdp+NEW.province_gdp-OLD.provionce.ggp
    where country_id=@ctry;
end;



Edited 1 time(s). Last edit at 01/08/2014 03:50PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
1854
January 08, 2014 03:30AM
Re: trigger new row join other table
1038
January 08, 2014 03:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.