MSSQLAggregate FunctionsAVG
SUM

AVGAggregate Functions

MIN

Returns the average.

Syntax

AVG(expr)

Example

Enter values below to update the example in real time.

department_id
salary
avg_salary
employees
SELECT department_id, AVG(salary) AS avg_salary
FROM employees
GROUP BY department_id;