SQL Aggregate Functions
Aggregation functions — COUNT, SUM, AVG, MIN, MAX, GROUP BY, HAVING. This category documents 26 SQL aggregate functions entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example tested against MySQL, PostgreSQL, SQL Server, and SQLite. The entries are: COUNT(), SUM(), AVG(), MIN(), MAX(), GROUP_CONCAT() / LISTAGG(), STRING_AGG(), VARIANCE() / VAR_SAMP(), STDDEV() / STDDEV_SAMP(), BIT_AND(), BIT_OR(), FILTER Clause (Aggregate), GROUPING(), GROUP BY ROLLUP, GROUP BY CUBE, GROUPING SETS, GROUP_CONCAT (Order/Limit), COUNT(DISTINCT), CORR() / COVAR_SAMP(), REGR_SLOPE / REGR_INTERCEPT, MEDIAN(), EVERY() / BOOL_AND() / BOOL_OR(), GROUP BY ROLLUP Subtotals with ORDER BY, COUNT with DISTINCT Window, APPROX_COUNT_DISTINCT, ROLLUP with Partial Grouping. Not sure where to start? COUNT() and SUM() are the most commonly used entries in this category. You can also search across every category from the search page, browse the complete A–Z index, or try any of these statements live in the SQL playground.