我觉得我的语法不是很正确,并尝试了几种不同的编写方式,我做错了什么?
UPDATE `allranks`
SET `allranks`.`Ranktwo` = `therankings`.`Rank`
FROM `allranks`
INNER JOIN `therankings`
ON (`therankings`.`Player Name` = `allranks`.`Player Name`)
答案 0 :(得分:2)
正确的MySQL语法是:
UPDATE allranks ar INNER JOIN
therankings r
on ar.`Player Name` = r.`Player Name`
SET ar.Ranktwo = r.Rank;
注意表别名如何使查询更容易编写和阅读。