Skip to content

COUNT

  • expression: It could either be a specific string, the name of a column for which the total number of non-NULL values is to be returned, or an asterisk (*) indicating that the function should count all rows irrespective of the contents. The COUNT() function returns the number of rows that match a specified criterion.
SELECT COUNT(EmployeeID)
FROM Employees;
| COUNT(EmployeeID) |
|-------------------|
| 50 |

The above SQL statement counts the total number of EmployeeID in the Employees table providing the total number of employees currently available in the database.