SQL

COUNT Function

English

Overview

An aggregate function that counts rows.

Details

A function that counts rows in a specified column or across the whole table, requiring care around how NULL is handled. COUNT(*) counts rows themselves, while COUNT(column) counts only rows where that column isn't NULL -- mixing these up is a common source of unexpectedly off aggregate results.

More Database terms