在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是不是很讓人無語??
MySQL也真是讓人鬱悶(關於子查詢中使用limit)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.