我在寻找的东西similar- insert into table1(a, b, c)
select col1 as d, col2 as e, col3 as f from table2
on duplicate key update b = e, c = f;
注意:如果不存在更新。 我收到错误 - 未知的列名'e'。 是否有任何解决方案使用'重复键'与'插入选择'语句? 谢谢!
我有一个文件,我已成功更新到表。现在,我需要以数据不会重复的方式再次执行此操作。 我的目标表: mysql> show columns from MARCAS;
+----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |