最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
MySQL获取所有分类和每个分类的前N条记录
时间:2022-11-14 23:37:32 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
SELECT A1.* FROM Article AS A1 INNER JOIN (SELECT A.Category,A.InsertDate FROM Article AS A LEFT JOIN Article AS B ON A.Category = B.Category AND A.InsertDate <= B.InsertDate GROUP BY A.Category,A.InsertDate HAVING COUNT(B.InsertDate) <= @N ) AS B1 ON A1.Category = B1.Category AND A1.InsertDate = B1.InsertDate ORDER BY A1.Category,A1.InsertDate DESC |
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22