我使用的答案在这里提供:Query rows for which meta data key does not existSQL简单的左加入提供错误
UPDATE table1
SET table1.id = table2.id
FROM table1
LEFT JOIN table2 ON table1.id=table2.id
WHERE table.id IS NULL
我期待将所有编号的表1至表2中对应的ID只在表1的id为空,但这给了“mysql错误”。
有什么想法? 预先感谢您。
是的,你可以[SQL小提琴](http://sqlfiddle.com/#!2/3e422/1/0)。像你提出的别名几乎是不允许的('update table1 outer') – Andomar