--将更新条件保存到临时表里 CREATE TABLE tmp3 AS (SELECT username FROM oa_user WHERE username NOT IN (SELECT username FROM nst_t_account)); --更新表数据,条件从临时表里取 UPDATE oa_user SET usr_update=NOW() WHERE username IN (SELECT username FROM tmp3); --删除临时表 DROP TABLE tmp3;
原文地址:https://www.cnblogs.com/penghq/p/9929142.html
时间: 2024-09-29 23:36:32