zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

MySQL也真是让人郁闷(关于子查询中使用limit)

mysql 查询 关于 limit 真是 使用
2023-09-11 14:19:34 时间

在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是不是很让人无语??