SELECT *
FROM (SELECT 分组的字段名,
ROW_NUMBER() OVER(PARTITION BY 分组的字段名 ORDER BY 排序的字段名) AS RN FROM 表名)
WHERE RN <= 10
oracle开展分组后,取出每组的前几条数据
点赞
收藏
oracle开展分组后,取出每组的前几条数据
SELECT *
FROM (SELECT 分组的字段名,
ROW_NUMBER() OVER(PARTITION BY 分组的字段名 ORDER BY 排序的字段名) AS RN FROM 表名)
WHERE RN <= 10