How to find maximum avg

前端 未结 15 2252
长情又很酷
长情又很酷 2020-12-15 19:17

I am trying to display the maximum average salary; however, I can\'t seem to get it to work.

I can get a list of the average salaries to display with:



        
15条回答
  •  一个人的身影
    2020-12-15 20:17

    select * from (select avg(sal) over (partition by deptno ) avrg,deptno from emp
    order by avrg desc) where rownum<2;
    

    Try the above one.

提交回复
热议问题