DELIMITER ||
CREATE TRIGGER tri_video_class
AFTER UPDATE ON 数据库名
.表名称
FOR EACH ROW begin
IF((old.status != new.status) or (old.status IS NULL && new.status IS NOT NULL))
THEN
UPDATE 数据库名称
.数据表名称
SET lession_status
= new.status
WHERE teacherId
= old.teacherId AND s_time
= old.s_time;
END IF;
END||
DELIMITER ;
转载于:https://www.cnblogs.com/2018-05-9-ygk/p/9396851.html