If you have the need to have the average value of an expression in a query, the right thing is to use the Oracle AVG function.
The syntax of the function is:
SELECT AVG (expression)
FROM table
[WHERE condition];
Or, if you want to group the result by one or more columns, you can use AVG by adding GROUP BY. Here is an example:
SELECT expression, expression, … expression n, AVG (aggregate expression)
FROM tables
[WHERE conditions]
GROUP BY expression, expression, … expression n;
Well, that’s it folks. Inquiries, please contact us.
Strong hug
Eduardo Santana
bufallos@bufallos.com.br