Aggregate#
Aggregate functions perform a calculation on a set of values and return a single value. Apart from
COUNT(*), they ignore null values.
Function |
Description |
|---|---|
Returns the number of rows in a data set that have distinct non-NULL values, where the return value is within a specified range of error tolerance. APPROX_COUNT_DISTINCT can return a value between 0 and 247. |
|
Returns the average of the values in a group. Null values are ignored. |
|
Returns the checksum of the values in a group. Null values are ignored. Can be followed by the OVER clause. |
|
Returns the number of items in a group. COUNT works like the COUNT_BIG function. The only difference between the two functions is their return values. COUNT always returns an int data type value. COUNT_BIG always returns a bigint data type value. |
|
Returns the number of items in a group. COUNT_BIG works like the COUNT function. The only difference between the two functions is their return values. COUNT_BIG always returns a bigint data type value. COUNT always returns an int data type value. |
|
Indicates whether a specified column expression in a GROUP BY list is aggregated or not. GROUPING returns 1 for aggregated or 0 for not aggregated in the result set. GROUPING can be used only in the SELECT <select> list, HAVING, and ORDER BY clauses when GROUP BY is specified. |
|
Is a function that computes the level of grouping. GROUPING_ID can be used only in the SELECT <select> list, HAVING, or ORDER BY clauses when GROUP BY is specified. |
|
Returns the kurtosis of the values in the expression. |
|
Returns the maximum value in the expression. |
|
Returns the minimum value in the expression. May be followed by the OVER clause. |
|
Returns the skewness of the values in the expression. |
|
Returns the statistical standard deviation of all values in the specified expression. |
|
Returns the statistical standard deviation for the population for all values in the specified expression. |
|
Concatenates the values of string expressions and places separator values between them. |
|
Returns the sum of all the values, or only the DISTINCT values, in the expression. SUM can be used with numeric columns only. Null values are ignored. |
|
Returns the statistical variance of all values in the specified expression. May be followed by the OVER clause. |
|
Returns the statistical variance for the population for all values in the specified expression. |