当前位置:Gxlcms > mysql > mysql触发器语法错误问题

mysql触发器语法错误问题

时间:2021-07-01 10:21:17 帮助过:27人阅读

mysqlsql数据库触发器

CREATE TRIGGER tradecost
AFTER UPDATE ON fentrust
FOR EACH ROW
BEGIN
DECLARE old_account DECIMAL(16,6)
DECLARE old_fid INT(10)
DECLARE trade_account DECIMAL(16,6)

SET old_fid = SELECT old_fid FROM fentrust WHERE old.fEntrustType = 1 AND old.fstatus = 1 AND new.fstatus IN(2,3)
SET trade_account = (SELECT fsuccessamount FROM fentrust WHERE old.fEntrustType = 1 AND old.fstatus = 1 AND new.fstatus IN(2,3))
SET old_account = (SELECT ftotalrmb FROM fwallet WHERE fid = old_fid)

UPDATE fwallet SET ftotalRMB = (old_account-trade_account*0.005)

END

上面的语法有问题 总报错 求助应该怎么写 谢谢

人气教程排行