bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL COUNT() Function

Example

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
)

Parameter Values

ParameterDescription
expressionRequired. A field or a string value

Technical Details

Works in:From MySQL 4.0

Previous

MySQL COT() Function

Next

MySQL DEGREES() Function