|
-
October 2nd, 2001, 11:20 PM
#1
SQL Query
Find DeptNo in which Maximum number of Employees are working from Employee table having EmpNo and DeptNo as fields.
-
October 3rd, 2001, 02:29 AM
#2
Re: SQL Query
This will give you one record with one field, containing the DeptNo that has the most employees in it
SELECT TOP 1 DeptNo
FROM Employees
GROUP BY DeptNo
ORDER BY Count(DeptNo) DESC
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|