Row Aggregates and compute

Row aggregates can be used with compute statement.

This table describes how aggregates are used with a compute statement:

Row Aggregates

Result

sum

Total of the values in the expression

avg

Average of the values in the expression

max

Highest value in the expression

min

Lowest value in the expression

count

Number of selected rows as an integer

count_big

Number of selected rows as a bigint

These row aggregates are the same aggregates that can be used with group by, except there is no row aggregate function that is the equivalent of count(*). To find the summary information produced by group by and count(*), use a compute clause without the by keyword.