📜  两个表之间的 mysql 过程 - SQL 代码示例

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

代码示例1
1. SET GLOBAL event_scheduler=ON
2. CREATE EVENT update_status_event
    ON SCHEDULE
      EVERY 1 DAY
ON COMPLETION NOT PRESERVE ENABLE
    COMMENT 'Suspend Phone Service If Remaining Days < 0'
    DO
       UPDATE phone_services p, user_settings u SET p.phone_service_status = 2, u.is_app_enabled=0, u.device_identifier='' WHERE p.phone_service_device <> 'GP' AND p.remaining_days <= 0;