Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 mySQL Azure 实例中有两个数据库 db1 和 db2。我想从 tbl1 批量更新 tbl2 中的列。
我想使用基于表 tbl1 和 tbl2 中的匹配列值而不是主键的 select 语句执行批量更新语句。
以下是如何在 mySQL 中使用通过两个数据库连接的 Select 实现来实现批量更新。
您可以对同一数据库中的两个表执行相同的想法,只需在下面的查询中重命名实例名称!
update db2.make set ImageUrl = ( select ImageUrl from db1.make where db1.make.MakeName = db2.make.MakeName );