4
SQL group (aggregate) functions operate on sets of values. If you use an aggregate function in a statement containing no GROUP BY clause, it is equivalent to grouping on all rows.
6
General syntax for aggregate functions is:
10
SELECT "function type" ("column_name")
13
The following are examples of aggregate functions:
15
**AVG**: Return the average value of the argument. (Does not work with temporal values unless first converted to numeric values.)
18
(DISTINCT): Return the count of a number of different values
20
:doc:`count`: Return a count of the number of rows returned
22
**GROUP_CONCAT**: Return a concatenated string
24
**MAX**: Return the maximum value
26
**MIN**: Return the minimum value
28
**STD**: Return the population standard deviation
30
**STDDEV_POP**: Return the population standard deviation
32
**STDDEV_SAMP**: Return the sample standard deviation
34
**STDDEV**: Return the population standard deviation
36
**SUM**: Return the sum. (Does not work with temporal values unless first converted to numeric values.)
38
**VAR_POP**: Return the population standard variance
40
**VAR_SAMP**: Return the sample variance
42
**VARIANCE**: Return the population standard variance