AVG
Description
This aggregate function calculates the average of a set of values.
AVG calculates the average of an INT or FLOAT column. The data type of the result is always a FLOAT.
Syntax
AVG ( table.column )
NULL handling
NULL values are ignored, so they do not influence the result. If all the values of a group are NULL, the result for this group is also NULL.
Use Cases
AVG
can be used for Working Capital Optimization.
Examples
[1] Calculating the average of four small integers: | |||||||||||
| |||||||||||
|
[2] Calculating the average of values grouped by country: | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
|
[3] Calculating the average of values mixed with nulls, grouped by country: | ||||||||||||||||||
| ||||||||||||||||||
|