A simple MySQL trigger example requires that a field in a table be updated. If the new value is smaller than the old value in the table, the old value and the new value are added, and then update; otherwise, the system will be updated normally. Consider using the MySQL trigger to trigger the update. The following is a specific SQL statement. [SQL] -- delete TRIGGER DROP TRIGGER trigger_ads; -- CREATE TRIGGER DELIMITER // CREATE TRIGGER trigger_ads BEFORE UPDATE ON stats_ads FOR EACH ROW BEGIN IF OLD. VIEW> NEW. view then set new. VIEW = OLD. VIEW + NEW. VIEW; end if; if old. view_unique> NEW. view_unique then set new. view_unique = OLD. view_unique + NEW. view_unique; end if; if old. click> NEW. click then set new. click = OLD. click + NEW. click; end if; if old. click_unique> NEW. click_unique then set new. click_unique = OLD. click_unique + NEW. click_unique; end if; if old. START> NEW. start then set new. START = OLD. START + NEW. START; end if; if old. start_unique> NEW. start_unique then set new. start_unique = OLD. start_unique + NEW. start_unique; end if; if old. landing> NEW. landing then set new. landing = OLD. landing + NEW. landing; end if; if old. landing_unique> NEW. landing_unique then set new. landing_unique = OLD. landing_unique + NEW. landing_unique; end if; END; // you can use the following SQL statement to view all triggers: [SQL] -- View mysql trigger SELECT * FROM information_schema. 'trigger ';