SELECT manager_id, last_name, hire_date, salary,
AVG(salary) OVER (PARTITION BY manager_id ORDER BY hire_date
ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS c_mavg
FROM employees;Use the PARTITION BY clause to partition the query result set into groups
based on one or more value_expr. If you omit this clause, the function treats
all rows of the query result set as a single group.
You can specify multiple analytic functions in the same query, each with the
same or different PARTITION BY keys.