想用触发器实现两个表同步增加数据 本来用的测试表 弄成了 让后在作完新表添加触发器 添加不了了 然后我又换的语句也是不行都报错1064 看一下哪个地方出错了
BEGIN
INSERT INTO person
(person_number,student_name,student_phone,student_class,student_year) SELECT student_number,student_name,student_phone,student_class,student_year FROM student
WHERE not exists (select * from person where person.person_number = student.student_number);
END
BEGIN
INSERT INTO person
(student_number
,student_name
,student_phone
,student_class
,student_year
)
VALUES (new.student_number
,new.student_name
,new.student_phone
,new.student_class
,new.student_year
);
END