4 ms·
The problem with SQL is that this behaviour is inconsistent when it comes to NULL values. Consider a column with values (10, 20, NULL, 30). In SQL the AVG() f
by qayxc 4y ago
The problem with SQL is that this behaviour is inconsistent when it comes to NULL values.
Consider a column with values (10, 20, NULL, 30).
In SQL the AVG() function would return 20, i.e. ignoring the NULL value entirely. COUNT(*) on a table, however, would happily include NULL values, whereas COUNT(col_name) wouldn't. The behaviour is all over the place, especially when different dialects and settings are considered.
- benji-york 4y agoThanks for taking the time to respond. I appreciate it.