我在我的表comment
中添加了一个外键id_customer
。 但现在我需要将这个外键id_customer
与主键同步到customer
表中。SQL更新,比较和外键
为此我将电子邮件比较为customer
和comment
。
UPDATE comment
SET comment.id_customer = customer.id
FROM comment, customer
WHERE comment.email = customer.login
显然我有一个语法错误。有人可以告诉我为什么我错了? 我也尝试了INNER JOIN,但结果相同。
谢谢。 Sry为我的英语。