Home » SQL & PL/SQL » SQL & PL/SQL » sql response
sql response [message #19190] Mon, 04 March 2002 18:49 Go to next message
Gopal Raw
Messages: 19
Registered: January 2002
Junior Member
How can i get the only department name from a table
which has more employees rather then other department.
Re: sql response [message #19196 is a reply to message #19190] Mon, 04 March 2002 22:33 Go to previous message
Manoj
Messages: 101
Registered: August 2000
Senior Member
Hi gopal,

select dname from dept where deptno in (select deptno from(select DEPTNO ,count(*) from emp group by DEPTNO order by 2 desc
) where rownum<2)

use it.
Previous Topic: Segmentation/Partitioning
Next Topic: deleting rows having even rownum
Goto Forum:
  


Current Time: Tue Apr 23 13:37:45 CDT 2024