我想更新表 b 中的描述。在表a中我有最新的数据。我想加入表 b 中可用的所有数字并更新描述。仅必须更新表 b 中可用的数字!
我有这个查询:
select * from b
left join a.prod_nr = b.prod_nr
但是我怎样才能更新字段呢?性能如何,因为更新了 8000 行。
我有表a
prod_nr description
1 test
2 things
3 pc
表b
prod_nr description
1 nothing
3 monitor
表b中查询后的输出:
prod_nr description
1 test
3 pc
最佳答案
update b
join a on a.prod_nr = b.prod_nr
set b.description = a.description
关于mysql - 更新数据库中的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33171126/