我遇到这种情况:
表ASSET
表USERS
现在我想在设备表上删除name \ surname列,并用user表的相对id_users填充id_users。
样品:
我尝试过这些查询:
1)
UPDATE asset t1
INNER JOIN users t2
ON t1.name = t2.name and t1.surname = t2.surname
SET t1.id_users = t2.id_users
2)
UPDATE asset
SET asset.id_users = (
SELECT users.id_users
FROM users
WHERE asset.name = users.name AND asset.surname = users.surname
);
两个查询我都收到此错误:
#1136 - Column count doesn't match value count at row 1
你能帮帮我吗?