最新下载
热门教程
- 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 |
相关文章
- 无限暖暖搭乘大鸟巴士怎么玩 公测第三天每日任务做法介绍 12-27
- 奇迹暖暖绚光护佑搭配攻略 奇迹暖暖绚光护佑过关攻略 12-27
- 绝区零月城柳意像影画怎么样 12-27
- 无限暖暖翩翩愿飞去怎么样 12-27
- 黑神话悟空1.0.12.16581版本更新公告 12-27
- 光遇12.27红石碎片在哪里 12-27