网站首页技术博客

Mysql子查询不支持limit解决办法​

洞天水月2021-03-12 14:32:282080人次阅读
摘要This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery

在MySQL4.1中子查询是不能使用LIMIT的,手册中也明确指明 “This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’ ”

也就是说,这样的语句是不能正确执行的。
select * from table where id in (select id from table limit 10);

但是,,但是,,,只要你再来一层就行。。如:
select * from table where id in (select t.id from (select * from table limit 10)as t)

你说说,MySQL是不是很让人无语??


文章评论