标签:into each money drop new insert limit update rop
删除
Drop trigger tri_cus_wallet_update;
创建
DELIMITER $
CREATE TRIGGER tri_cus_wallet_update AFTER UPDATE ON cus_wallet FOR EACH ROW
BEGIN
INSERT INTO cus_wallet_his(
orgid,
userid,
rechargemoney,
subsidymoney,
totalmoney,
integral,
rechargemoney_new,
subsidymoney_new,
totalmoney_new,
create_user,
create_time,
update_user,
update_time,
reserve1
)values(
OLD.orgid,
OLD.userid,
(NEW.rechargemoney-OLD.rechargemoney),
(NEW.subsidymoney-OLD.subsidymoney),
OLD.totalmoney,
OLD.integral,
NEW.rechargemoney,
NEW.subsidymoney,
NEW.totalmoney,
OLD.create_user,
now(),
OLD.update_user,
now(),
NEW.reserve1
);
END $
DELIMITER ;
标签:into each money drop new insert limit update rop
原文地址:https://www.cnblogs.com/Mr-xy/p/11653771.html