login

SQL AVG Function

The SQL AVG function calculates the arithmetic average of the series of numbers of its argument. The syntax is simple as follows:

AVG ([DISTINCT]|[ALL] <numeric expression="">)

For example, the following query could be used to calculate the average salary of all employees in employees table:

SELECT AVG(salary) average_salary  
FROM employees
average_salary
--------------
   2950.000000