c
count(column-name)
returns the amount of non-NULL values for the column.
a
and b
can contain NULL values, but c
can’t.
mysql> select a + b + c from tt.dfttst; +-----------+ | a + b + c | +-----------+ | 3 | | NULL | | 0 | +-----------+ 3 rows in set (0.00 sec)
Any calculation with NULL
will result in NULL
.