Vote count:
0
I want the field current_price in table stock to be updated when we insert new into table stock_changes.
So stock.current_price should be updated to stock_changes.current_price
I have tried with triggers but it wont work.
CREATE TRIGGER update_stock
AFTER INSERT ON stock_changes
FOR EACH ROW
UPDATE stock
SET current_price =NEW.current_price
WHERE id = NEW.stock_id;
asked 34 secs ago
Aucun commentaire:
Enregistrer un commentaire