【发布时间】:2018-03-14 23:29:20
【问题描述】:
我正在尝试创建一个触发器,将 +1 添加到我的dispens_counter
我有 3 张桌子:
dispense_table:
MasterID - containerID
master_table:
MasterID - customerID
container_table:
containerID - customerID - dispense_counter
我想要做的是,在每次插入到我的dispens_table 之后,我想向我的dispens_counter 添加 +1
WHERE
master_table.customerID = container_table.customerID AND
dispense_table.MasterID = master_table.MasterID AND
dispense_table.containerID = container_table.containerID
所以每次我在我的dispens_table 中获得分配时,我想在我的container_table 中添加+1,因为它非常繁忙,并且需要一些时间来在给定的时间内运行分配查询。
所以
CREATE TRIGGER dispense_adding AFTER INSERT ON dispense_table
FOR EACH ROW BEGIN
????
END
【问题讨论】: