按部门统计员工数,查出员工数最多的部门的第二名到第五名(列出部门名字,部门位置)
select d.dname, d.loc, d.deptno from dept d, ( select rownum no, deptno from ( select count(*) 人数, deptno from emp group by deptno order by 人数 desc ) ) e where e.no between 2 and 5 and e.deptno = d.deptno;