join query
Database
4
Posts
4
Posters
12
Views
1
Watching
-
how to find one employee belongs to max dept
-
how to find one employee belongs to max dept
-
how to find one employee belongs to max dept
What is "employee"? What is "dept"? What is the relationship between them?
-
how to find one employee belongs to max dept
With as little information as you have supplied this may give you some ideas.
select *
from Employee
where DepartmentID =(
select top 1 DepartmentID from(
select DepartmentID , count(*) C
from Employee
group by DepartmentID) x order by C desc)Never underestimate the power of human stupidity RAH