Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要正确的 mysql 触发器语法我使用的是 5.1 版,并且在我编写 sql 语句时总是出现语法错误
DELIMITER $$ CREATE TRIGGER blood_year AFTER INSERT ON donor FOR EACH ROW BEGIN INSERT INTO blood_donation (donation_year)VALUES (YEAR(NOW())); END$$
任何的想法??
尝试在末尾添加另一个“DELIMITER”语句:
DELIMITER $$ CREATE TRIGGER blood_year AFTER INSERT ON donor FOR EACH ROW BEGIN INSERT INTO blood_donation (donation_year)VALUES (YEAR(NOW())); END$$ DELIMITER ;