Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | id | opening_balance | closing_balance | user_id |
- |----|-----------------|-----------------|---------|
- | 1 | 23.40 | 28.20 | 6 |
- | 2 | 14.70 | 11.10 | 79 |
- | 3 | 117.12 | 107.12 | 20 |
- CREATE TRIGGER balance_update
- AFTER INSERT ON balance_history
- FOR EACH ROW
- BEGIN
- UPDATE users
- SET balance = NEW.closing_balance
- WHERE id = NEW.user_id;
- END;
Add Comment
Please, Sign In to add comment