数据库
首页 > 数据库> > mysql批量新增覆盖原表数据

mysql批量新增覆盖原表数据

作者:互联网

insert into table_name (uid, user_name, email, department_id, department_name, role_id, is_delete) VALUES 
    (%s, %s, %s, %s, %s, %s, %s)
          ON DUPLICATE KEY UPDATE 
          user_name = VALUES(user_name),
          email = VALUES(email), 
          department_id = VALUES(department_id),
          department_name = VALUES(department_name),
          role_id = VALUES(role_id),
          is_delete = VALUES(is_delete)

# 主键为uid

标签:name,批量,mysql,email,VALUES,原表,department,role,id
来源: https://www.cnblogs.com/itBlogToYpl/p/16382978.html