create or replace trigger A表_Upzhbefore insert or update ON A表FOR EACH ROWDECLAREBEGIN IF :new.stop_time is not null then :new.differ_time= ceil((:new.stop_time-:new.start_time)*24*60); end if;END A表_Upzh;
先判断stop_time是否为空,如果不为空,则相减得出时间相差的分钟数