mysql最多巢狀幾層 limit不支援內層巢狀

2021-10-20 23:20:18 字數 698 閱讀 2200

limit不支援內層巢狀

[select * from c_talk where talk_id in ( select talk_id from c_post group by talk_id order by count(post_id) limit 0,14)]提示limit不支援內層。。。

mysql什麼版本? 應該支援, 錯誤提示的實際內容是什麼?

到底是不支援limit還是缺少別名? 加上t再試。

select * from c_talk where talk_id in ( select talk_id from c_post group by talk_id order by count(post_id) limit 0,14) t

select * from c_talk a,(select talk_id,count(*) as pid from c_post group by talk_id)b

where a. talk_id=b.talk_id

order by b.pid

limit 0,14;

select * from c_talk a

inner join

select talk_id from c_post group by talk_id order by count(post_id) limit 0,14) b

on a.talk_id=b.talk_id

Mysql分頁之limit用法與limit優化

與oracle和ms sqlserver相比,mysql的分頁方法簡單的讓人想哭。語法 select from table limit offset,rows rows offset offset 舉例 select from table limit5 返回前5行 select from table...

Mysql分頁之limit用法與limit優化

與oracle和ms sqlserver相比,mysql的分頁方法簡單的讓人想哭。語法 select from table limit offset,rows rows offset offset 舉例 select from table limit 5 返回前5行 select from tabl...

使用子查詢提高MySQL分頁效率 limit

2 offset大的時候。select from yanxue8 visit limit 10000,10 多次執行,時間保持在0.0187左右 select from yanxue8 visit where vid select vid from yanxue8 visit order by vi...