想建立一个触发器,当有更新为d_lastUpdate=null时(d_lastUpdate为这条记录的更新时间,就是这条记录当前没有更新),触发器把b_hostState设置为0 触发器代码如下: delimiter | create trigger manager_bu before update on manager for each row begin if new.d_lastUpdate=null then set new.b_hostState=0; end if ; end;| delimiter ; 问题是当update manager set d_lastUpdate=null where v_studentName like '汪%'; d_lastUpdate变为null,b_hostState不会变成0(原来是1状态) 由于只有一个表不能使用after update,如果现在想实现这个功能怎么修改啊,急~~~~~~~~~~`if new.d_lastUpdate=null-> if new.d_lastUpdate is null 还有一个问题就是该触发器每5分钟触发一次,不论是否有更新,是不是要用event Event Scheduler控制,怎么弄? if new.d_lastUpdate=null then
-------->
if new.d_lastUpdate is null then 不能 "=null" 有结果了,但是=null和is null有什么分别么? NULL不等于NULL,判断NULL要用IS NULL 了解,如果要实现每5分钟执行一次用什么方法最简单,要Event Scheduler么?