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
What do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
Explain what does a control file contain?
Does oracle charge for java?
Can we protect our pl/sql source code?
What is the difference between sharding and partitioning?
How to create a new table by selecting rows from another table?
How do you tell what your machine name is and what is its IP address?
How to bring a tablespace offline?
How to view all columns in an existing table?
How to use subqueries with the in operator using oracle?
Respected sir, Please send me technical questions related to oracle apps..
List out the difference between commit, rollback, and savepoint?
What is transaction control statement and how many types of transaction control statement in Oracle?
What happens to the current transaction if the session is killed?
what is meant by magic query