这有效
SELECT * FROM productinfo a
WHERE NOT EXISTS(SELECT NULL
FROM productinfo_temp b
WHERE a.ProductID = b.ProductID)
但是,它想根据该结果更新 productinfo 表
UPDATE a SET Deleted = '1' FROM productinfo a
WHERE NOT EXISTS(SELECT NULL
FROM productinfo_temp b
WHERE a.ProductID = b.ProductID)
但它不起作用。更新有什么问题?这是错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM productinfo a WHERE NOT EXISTS(SELECT NULL FROM productinfo' at line 1