oracle Group by 分组查询后,分页

------------恢复内容开始------------

1.分页查询 select count(*) times,title from menulog group by title order by count(*) desc 

2, 生成一个带rn字段的表tableRN=(SELECT rownum as rn, a.* FROM (select count(*) times,title from menulog group by title order by count(*) desc ) a)

3  select  * from  tableRN where rn between 0 and 6

select * from(SELECT rownum as rn, a.* FROM (select count(*) times,title from menulog group by title order by count(*) desc ) a) 

where rn between 0 and 6

 

------------恢复内容结束------------

猜你喜欢

转载自www.cnblogs.com/zytcomeon/p/13207611.html