问题遇到的现象和发生背景
按照书上例子写报错,但不理解,不会改
问题相关代码,请勿粘贴截图
mysql> CREATE TRIGGER Student_Count
-> AFTER INSERT ON Student
-> REFERENCING
-> NEW TABLE AS DELTA
-> FOR EACH STATEMENT
-> INSERT INTO StudentInsertLog(Numbers)
-> SELECT COUNT(*)FROM DELTA;
运行结果及报错内容
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REFERENCING
NEW TABLE AS DELTA
FOR EACH STATEMENT
INSERT INTO StudentInsertLog(N' at line 3
我想要达到的结果
将每次对表Student的插入操作所增加的学生个数记录到表StudentInsertLog中