Table 6.1 lists SQL’s standard aggregate functions. The important characteristics of the aggregate functions are:
In Table 6.1, expr often is a column name, but it also can be a literal, function, or any combination of column names, literals, and functions coupled by operators.
SUM() and AVG() work with only numeric data types. MIN() and MAX() work with characters, numeric, and datetime data types. COUNT(expr) and COUNT(*) work with all data types.
All aggregate functions except COUNT(*) ignore nulls. (You can use COALESCE() in an aggregate function argument to substitute a value for a null; see “Checking for Nulls with COALESCE()” in Chapter 5.)
COUNT(expr) and COUNT(*) never return null but return either a positive integer ...