我遇到了SQL UPDATE命令的问题。我有两个表,Customer和Customer2。客户表包含所有客户信息。 Customer2表包含具有优秀发票的客户。我正在尝试使用Customer表中的区号更新Customer2表。两个表的匹配部分是列CUS_CODE。SQL更新表1到表2
这是我到目前为止有:
UPDATE Customer2
SET Customer2.cus_areacode = Customer.cus_areacode
FROM Customer2
INNER JOIN Customer
ON (customer.cus_code = customer2.cus_code)
WHERE customer.cus_code = customer2.cus_code;
我得到一个语法错误开始“从顾客2”。我一直在努力争取这项工作,任何帮助将不胜感激。我正在使用MS Access中的SQL执行此任务。
http://stackoverflow.com/questions/1375207/how-do-i-perform-update-query-with-subquery-in-access –