答案 0 :(得分:0)
根据我的理解,我建议这个概念使用触发器,
DELIMITER $$
CREATE TRIGGER trg_insert
AFTER INSERT ON market
begin
update bags set qty = ((select qty from bags where id=1)-(select
market.total_qty from market where
id=1) ))
,price = ((select price from basgs where id=1)-(select market.total_prc
from market where
market.id=1)))
where bags.id = 1;
END$$
DELIMITER $$
现在我正在使用提供给您的静态值, 试试这个代码。