简体   繁体   English

如何将新表列匹配并插入到先前的数据库列

[英]How to match and insert new table column to a previous database column

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

Above is the image of what I am working with.上面是我正在使用的图像。

I need to insert the Styletype column so that the StyleYype matches up with the StyleCode column.我需要插入 Styletype 列,以便 StyleYype 与 StyleCode 列匹配。

seems you need update based on join似乎您需要根据加入进行更新

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在庞大的MYSQL数据库表中插入新列? - How to insert a new column in a huge MYSQL Database Table? 如何根据product_Id将日期插入表2中的新列并匹配表1中的(product_id)并使用列(date)添加到表2 - How to insert a date to new column in table 2 based on product_Id and match the (product_id) in table 1 and use a column (date) to add to table 2 如何在数据库中插入列的新名称 - How to insert new name for column in database MySQL:使用 id 将 table2 中的条目与 table1 中的条目匹配,然后将匹配项作为新列插入 table2 - MySQL: Match entry in table2 to those in table1 using an id, then insert matches as new column into table2 如何将一个表的值与另一个表的值匹配并在 mySQL 中创建一个新列? - How to match value of a table to another and create a new column in mySQL? 一次添加新列后如何在表中插入值? - How to insert values in table after adding new column at once? 如何在表格的x后面插入新列? - How can I insert a new column after x on a table? 如何仅在MYSQL数据库的表的列中为Null集插入值 - How insert a value only for Null set in a column in a table in MYSQL Database 如何将所有数据库值插入列表列表中? - How to insert all database values into a column table list? MySQL 触发器 - 复制新。 插入的数据与现有列值进行比较,如果匹配,则将它们插入其他表 - MySQL Trigger - Copy NEW. inserted data compare to existing column values and then insert them to other table if they match
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM