SQL GROUP BY Clause

Ranjeet_8
Posted by Ranjeet_8 under Sql Server category on | Points: 40 | Views : 1544
If u want to know total number of employee on each department.
Query will be :

SELECT Dept,COUNT(Dept) as Total
FROM Employee_Table
GROUP BY Dept

Result:

Dept Total
HR 1
IT 3
Marketing 2
Sales 1

Comments or Responses

Login to post response