Aggregate functions summarize data over a group of rows from the database. Simple aggregate functions, such as sum, avg, max, min, count_big, and count are allowed only in the select list and in the having and order by clauses as well as the compute clause of a select statement. These functions summarize data over a group of rows from the database
Adaptive Server supports statistical aggregate functions, which permit statistical analysis of numeric data. Statistical aggregate functions include stddev, stddev_samp, stddev_pop, variance, var_samp, and var_pop. See the Reference Manual: Building Blocks
These functions, including stddev and variance, are true aggregate functions in that they can compute values for a group of rows as determined by the query’s group by clause. As with other basic aggregate functions such as max or min, their calculations ignore null values in the input. All variance and standard deviation computation uses IEEE double-precision floating-point standard.
If the input to any variance or standard deviation function is an empty set, each aggregate function returns a null value. If the input to any variance or standard deviation function is a single value, then each function returns 0 as its result.