Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
Count in sql server example in Queries of SQL Queries
2953 Views
Hints 
COUNT() is one of the SQL Aggregate Function.In sql different Aggregate Functions are used to return values.For example AVG(),MAX(),FIRST(),LAST(),MIN(),SUM().

COUNT() used to return the count values of column from table.Syntax and example follows,
Syntax
select columnName from tableName group by columnName having COUNT(columnName)>value;
Example
Get the jobs that are done by more than two employees.

select job from Works_on group by job having COUNT(emp_no)>2;
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details