————————————前面已建触发器——————————————
mysql> create trigger upd_check before update on tb
-> for each row
-> begin
-> if new.a < 0 then
-> set new.a =0;
-> elseif new.a > 100 then
-> set new.a = 100;
-> end if ;
-> end ; //
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-> for each row
-> begin
-> if new.a < 0 then
-> set new.a =0;
' at line 2
是王小二呀
相关分类