綜合
評分
評分
8.80
- 內容實用9.2
- 簡潔易懂8.7
- 邏輯清晰8.5

不能截圖,只能在這評論了,第三個select 字句才是關鍵,可以根據這個字句去帥選得出cnt這個字段,稱之為字段吧,大家可以只用一張表來實現這個功能,比如:實現分類后取每個分類的前兩條數據,我貼兩條我sql語句吧,第一條不關聯其他表select c.id,c.name,cnt from(select a.fid,a.id,a.name,(select count(*) from test b where b.fid = a.fid and a.id >= b.id) as cnt from test a group by a.id,a.name) c where cnt<=2 限300字符汗
時間:2018-05-28
0/300
取消
回復
0/300
取消
回復
0/300
取消
回復