select * from (select t.*,row_number() over(partition by 分组字段 order by rownum) rn from 表名 t where 条件语句) where rn= 分组中的第几条;
引用:https://blog.csdn.net/liuhaolian/article/details/89375042