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 $$
1条答案
按热度按时间pengsaosao1#
根据我的理解,我建议这个概念使用触发器,
现在我正在使用提供给您的静态值,请尝试以下代码。