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.
我有一个以电话号码 ID 作为主键的电话号码表 [我将其称为表 1],还有一个包含客户列表的表。其中一些客户在电话号码字段 [表 2.] 中有一个电话号码。有谁知道我如何用指向表 1 中号码的外键替换表 2 中的号码?
沿着这些线尝试一些东西:
UPDATE T2 SET T2.phonenumber = T1.PRIMARY_KEY FROM TABLE2 AS T2 INNER JOIN TABLE1 AS T1 ON T1.phonenumber = T2.phonenumber