首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

delete表连接不支持limit,该如何处理

2012-06-15 
delete表连接不支持limitmysql delete test1 from test1 join test2 on test1.idtest2.id limit 10ERRO

delete表连接不支持limit
mysql> delete test1 from test1 join test2 on test1.id=test2.id limit 10;  
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 10' at line 1
mysql> 



[解决办法]
delete A FROM test1 A INNER JOIN (SELECT ID FROM test2 limit 10) B
on A.id=B.id ;

热点排行