2015-02-08 82 views

回答

0

這看起來像一個典型的用例爲before update觸發:

delimiter // 
CREATE TRIGGER mytable_upd_trg 
BEFORE UPDATE ON mytable 
FOR EACH ROW 
BEGIN 
    SET NEW.special_field = 1; 
END;// 
delimiter ; 
+0

謝謝Mureinik's – itsme 2015-02-08 16:51:01

1

CREATE TRIGGER t_name AFTER INSERT ON table_name

SET @attribute_name = 1;