Using Aggregate Functions Inside a Trigger In MySQL
by Ranganathan[ Edit ] 2012-06-01 18:30:11
<font size=5>
delimiter |
CREATE TRIGGER checkAge BEFORE INSERT ON People
FOR EACH ROW BEGIN
IF AVG(age) > 50 THEN
SET NEW.age = 20;
END IF;
END
|
delimiter ;
</font>