SQL触发更新

问题描述

大家好,我试图触发一个触发器,以便在每次向Reading添加新行时更新Bill.BillAmmount。 该字段应=(Reading.MeterReading-Reading.LastMeterReading)* Resedent.Rate)

REDEDENT 法案 阅读

是3张桌子 也非常感谢你

AFTER INSERT ON Reading
Begin
    UPDATE bill
    SET bill.BillAmount = (SELECT (Reading.MeterReading - Reading.LastMeterReading)*Resedent.Rate 
    FROM Reading,Resedent
    WHERE Reading.ReadingID = ReadingID AND Resedent.AccountID = AccountID)
End;

DROP TRIGGER BILLAMOUNT_ON_INSERT; ```


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)