Aggregation
Counting rows
How many rows are in table T?
Detailed semantics
- NULLs: We are counting rows, regardless of
values. Presence of NULLs have no impact on count(*).
- Duplicates: Duplicate rows are counted as distinct.
T
X |
Y |
1 | 10 |
2 | 21 |
2 | 22 |
3 | 30 |
3 | 30 |
4 | NULL |
NULL | NULL |
jao=# select count(*) from t;
count
-------
7
|