📜  SQL 触发器 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:22.959000             🧑  作者: Mango

代码示例5
BEGIN
 
UPDATE `product` 
    SET `price` =  NEW.price
    , `quantity` = NEW.quantity 
    , date_modified = NOW() 
    WHERE `product_id` = NEW.product_id;
    AND price > NEW.price 
    AND quantity > 0
;
 
END