数据库 Mysql
INSERT INTO table (column_list)
VALUES (value_list)
ON DUPLICATE KEY UPDATE
c1 = v1,
c2 = v2,
...;
尝试把数据插入表,如果主键冲突的话那么更新字段
参考自
http://www.mysqltutorial.org/mysql-insert-or-update-on-duplicate-key-update/
数据库 Mysql
INSERT INTO table (column_list)
VALUES (value_list)
ON DUPLICATE KEY UPDATE
c1 = v1,
c2 = v2,
...;
尝试把数据插入表,如果主键冲突的话那么更新字段
参考自
http://www.mysqltutorial.org/mysql-insert-or-update-on-duplicate-key-update/