A window function that assigns the average of the values in the field column for rows within the specified window frame to all rows in that window frame.
AVG returns the average of the values in a specified column for rows within the specified window frame to all rows in that window frame. AVG supports the ROWS clause.
This window function works analogously to the aggregate function AVG.
A column that specifies the rows of values to be averaged.
The following example compares each employee's salary against the average of the salaries earned by employees within that employee's department:
SELECT AVG(Salary) OVER (PARTITION BY Department) FROM Company.Employee