Aggregate functions

Aggregate functions generate summary values that appear as new columns in the query results. They can be used in a select list or the having clause of a select statement or subquery. They cannot be used in a where clause.

When an aggregate function is applied to a char datatype value, it implicitly converts the value to varchar, stripping all trailing blanks. In a similar manner, a unichar datatype value is implicitly converted to univarchar.