The Oracle and PL/SQL AVG function returns the average value of an expression.
The general format is:
AVG([DISTINCT | ALL] n)
AVG is allowed only on expressions that evaluate to numeric data types.
Example 1:
SELECT AVG(value) FROM INVOICE;
returns:
134.5678
Example 2:
SELECT ID, AVG(value) FROM INVOICE
GROUP BY ID;
returns:
#1 123.5674
#2 45.6754
...