mysql update 联表的情况下 对limit语法不支持。 Incorrect usage of UPDATE and LIMIT

报错:Incorrect usage of UPDATE and LIMIT

UPDATE a inner join b on a.material_vouche = b.material_vouche
SET a.lfbnr = b.lfbnr, a.lfpos = b.lfpos 
limit 10;

 

原因:For the multiple-table syntax, UPDATE updates rows in each table named in table_references that satisfy the conditions. In this case, ORDER BY and LIMIT cannot be used.(MySQL 文档)

翻译一下就是对于多表语法,UPDATE会更新table_references中每个表中满足条件的行。在这种情况下,不能使用ORDER BY和LIMIT。

posted @ 2024-01-28 01:39  了悟  阅读(336)  评论(0编辑  收藏  举报