Which Department has MOST NUMBER of employees?

Answer Posted / shibashis

Select d.deptname,count(*) as cnt
from employee e inner join dept d
On e.deptid=d.deptid
group by d.deptname
having cnt in (
select max(cnt) from
(SELECT deptid ,count(*) as cnt FROM employee GROUP BY deptid )
)
order by d.deptname
;

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?

4021


Explain what does a control file contain?

610


Does oracle charge for java?

591


Can we protect our pl/sql source code?

580


What is the difference between sharding and partitioning?

503






How to create a new table by selecting rows from another table?

554


How do you tell what your machine name is and what is its IP address?

1516


How to bring a tablespace offline?

543


How to view all columns in an existing table?

551


How to use subqueries with the in operator using oracle?

614


Respected sir, Please send me technical questions related to oracle apps..

1381


List out the difference between commit, rollback, and savepoint?

621


What is transaction control statement and how many types of transaction control statement in Oracle?

565


What happens to the current transaction if the session is killed?

536


what is meant by magic query

1775