Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,如果我在 TABLE1 上有 2 列名为“id”和“count”,其中包含“count”列中的数字,当这些数字达到 50 或以上时,我希望触发器更新 TABLE2 上名为“reached”的列,并使用“是”及其 id,在 id 列中
怎么做到呢?谢谢
delimiter | CREATE TRIGGER table1_trigger AFTER UPDATE ON table1 FOR EACH ROW BEGIN IF NEW.count >= 50 then update table2 set reached = 'yes' where id = NEW.id; end if; END; |