insert into `test` (`job_id`, `user_name`, `total_time`) values (‘12345‘, ‘zhangsan‘, ‘10‘) on duplicate key update `job_id` =‘12345‘,`user_name` = ‘zhangsan‘, `total_time`= ‘14‘;
会判断主键或唯一键,存在就更新,不存在就插入
原文地址:https://www.cnblogs.com/zhangxiaoj/p/11294409.html
时间: 2024-11-04 14:43:33