在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是不是很讓人無語??