Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in General only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
General
SQL Queries
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
sanjayvigil
New Member
Join Date:
Nov 2006
Posts:
4
#1
SQL Queries
Nov 17 '06, 02:27 PM
I have a table containing ManagerId,Emplo yId,Salary.
How can I find the manager with maximum number of employees
dswethar
New Member
Join Date:
Nov 2006
Posts:
65
#2
Nov 17 '06, 02:47 PM
Originally posted by
sanjayvigil
I have a table containing ManagerId,Emplo yId,Salary.
How can I find the manager with maximum number of employees
Hi,
Since you haven't specified which sql you are using, I am writing this query in t-sql syntax. Please change it accordingly.
SELECT TOP 1 ManagerID
FROM <table>
GROUP BY ManagerID
ORDERBY (COUNT(ManagerI D)) DESC
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment