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 @   了悟  阅读(686)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
点击右上角即可分享
微信分享提示