MySQL
0
Вклад в тег
DELIMITER $$
CREATE TRIGGER tgr_Posts_ins
AFTER INSERT
ON Posts FOR EACH ROW
BEGIN
SELECT count(1) INTO @countObj from Posts where ObjName = NEW.ObjName;
UPDATE Objects set PostsAmount = @countObj where ObjName = NEW.ObjName;
END$$
DELIMITER;