insert on duplicate key mysql update

 

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';

  Determines the primary or unique key, updates the presence, absence is inserted

Guess you like

Origin www.cnblogs.com/zhangxiaoj/p/11294409.html