Quick
Ref.
Functions
Data Types
|
AVGAVG gives the average (the mean) of a whole column or a group of rows for a single column of values. AVG is an aggregate function it is normally used with GROUP BY. The mean of the values a, b, c is (a+b+c)/3, you divide by 3 because there are 3 numbers in this example. NULL values do not contribute to the calculation.
SELECT region, AVG(population)
FROM bbc
GROUP BY region
See also: |