SQL HAVING Clause.

Ranjeet_8
Posted by Ranjeet_8 under Sql Server category on | Points: 40 | Views : 1038
If you want to display the department that has numbers of employee more than 2.
Query will be :

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

Result :

Dept Total
IT 10
HR 3

Comments or Responses

Login to post response