MSSQL Aggregate Functions
15 functions
COUNTCOUNT(expr)Returns the count of non-NULL rows.
COUNT_BIGCOUNT_BIG(expr)Returns the row count as BIGINT.
SUMSUM(expr)Returns the sum.
AVGAVG(expr)Returns the average.
MINMIN(expr)Returns the minimum value.
MAXMAX(expr)Returns the maximum value.
STRING_AGGSTRING_AGG(expr, sep) [WITHIN GROUP (ORDER BY ...)]Aggregates strings with a separator.
STDEVSTDEV(expr)Returns the sample standard deviation.
STDEVPSTDEVP(expr)Returns the population standard deviation.
VARVAR(expr)Returns the sample variance.
VARPVARP(expr)Returns the population variance.
CHECKSUM_AGGCHECKSUM_AGG(expr)Returns the checksum of a group.
GROUPINGGROUPING(expr)Returns whether a row is aggregated by ROLLUP/CUBE.
GROUPING_IDGROUPING_ID(expr, ...)Returns GROUPING results as a bitmask.
APPROX_COUNT_DISTINCTAPPROX_COUNT_DISTINCT(expr)Returns an approximate count of distinct values quickly.
