Aggregate Functions in SQL

Aggregate functions work with the collection of values and returns an aggregated single value after calculation. Below table list all the functions.

Function Description
Avg()  Avg() is used to calculate the average of values. Avg() function ignores Null values while calculating average.
Binary_checksum()  
Checksum_agg()  
Count()  Count() function returns the total number of items in a group. Count() function returns the int value
Count_big()  Count_big() function also returns the total number of items in a group. The different is in its return type. Count_big() returns bigint while count() returns int.
Grouping()  Grouping() function Indicates whether a specified column expression in a GROUP BY list is aggregated or not.
Max()  Max() function returns the maximum value in the expression. Max ignores the null values
Min()  Min() function returns the minimum value in the expression. Min function also ignores the Null values. Min function returns lowest value in the sort when applied on character column.
Stdev() Stdev() function returns the statistical standard deviation of all the values. Stdev() returns the float value
Stdevp()  Stdevp() function returns the statistical standard deviation for the population for all values in the specified expression. This function returns float value.
Sum()  Sum() function returns the sum of all the values. Null values are ignored during calculation. Sum() function can only be applied on numeric columns.
Var()  Var() function returns the statistical variance of all the values in the expression. This function returns the float value. Var() function can only be used with the numeric columns.
Varp()  Varp() functions returns the statistical variance for the population for all values in the specified expression.

Share this chapter
Comments
comments powered by Disqus

Navigation

Social Media