how to get the deptname where dept have maximum no of employees in dept
how to get the deptname where dept have maximum no of employees in dept
What is the code that you are working on ?
What you have tried so far ?
Select top 1 deptname, sum(deptname) as total from dept group by deptname order by total
---V V---
Vikas Vaidya
Select top 1 deptname, count(employee) as total from Employee group by deptname order by total.
hear we will get jest top one departname and count of employes but we need higest count of employes from depart name
how to get the deptname where dept have maximum no of employees in dept
I belive any DB this above two field should come in diff Table because both are coming in diff Level so
select top 1 d.deptname, count(e.empid) as total from emp e,department d where e.deptid = d.deptid
group by d.deptname
order by total desc
Thanks pradeep