日期:2014-05-16 浏览次数:20944 次
mysql> delimiter // mysql> create trigger upd_check before update on account -> for each row -> begin -> if new.amount < 0 then -> set new.amount=0; -> elseif new.amount > 100 then -> set new.amount = 100; -> end if; -> end; -> // Query OK, 0 rows affected (0.00 sec) mysql> delimiter ;