oracle 取各个分组的指定数量的值

select *
  from (select t.*,
               (Row_number() over(partition by f_group,
                                  f_area,
                                  f_areasub,
                                  f_grid order by f_number)) rn
          from T_COACH_USER t
         where t.f_grid is not null)
 where rn >= 6
   and rn <= 10;

你可能感兴趣的:(Oracle)