禁止更新xxx_xx表的password字段
CREATE TRIGGER xxx_xx_update(触发器名称) BEFORE UPDATE ON xxx_xx(表名)
FOR EACH ROW
BEGIN
IF OLD.password is not null THEN
SET NEW.password = OLD.password;
END IF;
END;
记录学习和工作
禁止更新xxx_xx表的password字段
CREATE TRIGGER xxx_xx_update(触发器名称) BEFORE UPDATE ON xxx_xx(表名)
FOR EACH ROW
BEGIN
IF OLD.password is not null THEN
SET NEW.password = OLD.password;
END IF;
END;
评论 (0)