MySQL Forums
Forum List  »  Triggers

Re: Trigger (Sales Update
Posted by: Peter Brawley
Date: April 10, 2018 02:34PM

Assuming a column sales.qty that stores no. of items sold, something like ...

create trigger salesins after insert on sales for each row
update product set stocklev=stocklev-new.qty;

For explanation see the manual page for Triggers.

Options: ReplyQuote

Written By
April 10, 2018 02:07PM
Re: Trigger (Sales Update
April 10, 2018 02:34PM

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.