UPDATE bestall SET view = t1.v, rawview = t1.rv
FROM bestall INNER JOIN beststat as t1
ON bestall.bestid = t1.bestid
此查询在附近给出语法错误
'FROM bestall INNER JOIN beststat as t1 ON bestall.bestid = t1.bestid' at line 3
有什么理由吗?
UPDATE bestall SET view = t1.v, rawview = t1.rv
FROM bestall INNER JOIN beststat as t1
ON bestall.bestid = t1.bestid
此查询在附近给出语法错误
'FROM bestall INNER JOIN beststat as t1 ON bestall.bestid = t1.bestid' at line 3
有什么理由吗?
这不是有效的 MySQL 语法。但是,它在 MS SQL Server中有效。对于 MySQL,使用:
UPDATE
bestall
JOIN beststat AS t1 ON bestall.bestid = t1.bestid
SET view = t1.v, rawview = t1.rv
MySQL 要求更新表在SET
子句之前。有关完整详细信息,请参阅MySQLUPDATE
语法参考。
试试这种方式:
UPDATE bestall INNER JOIN beststat as t1
ON bestall.bestid = t1.bestid SET view = t1.v, rawview = t1.rv