------------恢復內容開始------------
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

-----------------------
select count(*) times,max(url), title from menulog b group by title order by count(*) desc
------------------------
今天看公司的代碼,看到很多max或者sum某個字段的值這樣無意義的寫法,一開始很疑惑這樣寫是為了什么。
后來了解到,原來和后面使用到的group by有關,只要select的,不調用聚合函數的,一定要出現在group by里,而group by里出現的,不一定在出現在select里。
------------恢復內容結束------------
