从访问中的另一个 table 更新 table
update table from another table in access
我有两个表在访问
table1 (name,nat) 16000 records
table2 (v_name,id) 189000 records
我想用表 2 中的 ID 更新表 1 中的 nat。尝试了以下
UPDATE table1 SET nat = (SELECT table2.ID FROM table2 INNER JOIN table1 ON table2.V_name = table1.Name);
得到以下内容
error: Operation must use an updateable query
您可以尝试在访问
中使用UPDATE .... JOIN
UPDATE table1 t1
INNER JOIN table2 t2
ON t2.V_name = t1.Name
SET t1.nat = t2.ID
我有两个表在访问
table1 (name,nat) 16000 records
table2 (v_name,id) 189000 records
我想用表 2 中的 ID 更新表 1 中的 nat。尝试了以下
UPDATE table1 SET nat = (SELECT table2.ID FROM table2 INNER JOIN table1 ON table2.V_name = table1.Name);
得到以下内容
error: Operation must use an updateable query
您可以尝试在访问
中使用UPDATE .... JOIN
UPDATE table1 t1
INNER JOIN table2 t2
ON t2.V_name = t1.Name
SET t1.nat = t2.ID