Skip
Arish's avatar

62. COUNT Specific Column


COUNT Column

COUNT on a column ignores NULL values.

Syntax

sql
1SELECT COUNT(phone) FROM students;

Only counts rows where phone is NOT NULL.

Example

sql
1-- Count students with email
2SELECT COUNT(email) FROM students;