Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

COUNT

Example

Provide the count of products in the “Products” table.

SELECT COUNT(ProductID) AS NumberOfProducts FROM Products; 

Definition and Usage

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

Note: Excluding NULL values from the count.

Syntax

COUNT(expression)

Parameter Values

Parameter

Description

expression

Necessary: A field or a string value is required.

Technical Details

Works in: From MySQL 4.0