SQL COUNT Function

Example

Return the number of products in the “Products” table:

SELECT COUNT(ProductID) AS NumberOfProducts FROM Products;

Definition and Usage

The COUNT() function returns the number of records returned by a select query.

Note: NULL values are not counted.

Syntax

COUNT(expression)

Continue reading SQL COUNT Function

SQL COUNT() Function

The SQL COUNT() Function

The COUNT() function returns the number of rows that matches a specified criterion.

Example

Find the total number of rows in the Products table:

SELECT COUNT(*)
FROM Products;

Continue reading SQL COUNT() Function