首页 > 解决方案 > 如何将新表列匹配并插入到以前的数据库列

问题描述

https://imgur.com/a/0443EiL

上面是我正在使用的图像。

我需要插入 Styletype 列,以便 StyleYype 与 StyleCode 列匹配。

标签: mysqlsql

解决方案


似乎您需要根据加入进行更新

update table1
inner join table2 ON table2.style = table1.styleCode
set table1.styleType = table2,styleType 

推荐阅读