Aggregate Functions

The following functions (also called aggregate functions) can be used with the GROUP BY clause:

Title Description
Stored Aggregate Functions Custom aggregate functions.
AVG Returns the average value.
BIT_AND Bitwise AND.
BIT_OR Bitwise OR.
BIT_XOR Bitwise XOR.
COUNT Returns count of non-null values.
COUNT DISTINCT Returns count of number of different non-NULL values.
GROUP_CONCAT Returns string with concatenated values from a group.
JSON_ARRAYAGG Returns a JSON array containing an element for each value in a given set of JSON or SQL values.
JSON_OBJECTAGG Returns a JSON object containing key-value pairs.
MAX Returns the maximum value.
MIN Returns the minimum value.
STD Population standard deviation.
STDDEV Population standard deviation.
STDDEV_POP Returns the population standard deviation.
STDDEV_SAMP Standard deviation.
SUM Sum total.
VARIANCE Population standard variance.
VAR_POP Population standard variance.
VAR_SAMP Returns the sample variance.
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2021 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/aggregate-functions/