AVG is a set function.
The result of AVG is the arithmetical mean of the values of the argument.
AVG can only be applied to numeric values. The result has the data type FLOAT(38).
Example table: customer
How many corporate customers are taken into account? What is the average value of their account balance?
SELECT COUNT(*) number, FIXED (AVG(account),7,2) avg_account
FROM customer WHERE firstname IS NULL
NUMBER |
AVG_ACCOUNT |
2 |
4292.00 |