find out the 2nd most no. of employee working with dname from emp and dept table.
select d.dname,count(*) "totemp" from emp e,dept d
where e.deptno=d.deptno
group by (d.dname)
having count(*)=(select max(count(*)) from emp e,dept d
where e.deptno=d.deptno
group by d.dname);
This query will show highest no. of employee working with dname. But i want 2nd highest with dname.