sunanda Posted January 10, 2006 Share Posted January 10, 2006 hi all.. help me in writing a SQL Querythe table(EMP) has some columns such as Emp_name, Emp_id, Dept etcI want to count number of employees in each dept. the out put should look like this. Dept. Count aaa 10 bbb 15 ccc 10Thanks in advance.Regardssunanda Link to comment Share on other sites More sharing options...
aspnetguy Posted January 10, 2006 Share Posted January 10, 2006 SELECT Dept AS 'Department', COUNT(Emp_Id) AS 'Emp Count'FROM EMPGROUP BY Dept Link to comment Share on other sites More sharing options...
sunanda Posted January 11, 2006 Author Share Posted January 11, 2006 SELECT Dept AS 'Department', COUNT(Emp_Id) AS 'Emp Count'FROM EMPGROUP BY Dept <{POST_SNAPBACK}> hi (aspnetguy)..Thanks a lot for the code.Regardssunanda Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now