Now, it might be tempting to use window functions in a
WHERE clause, as in the example:
WHERE salary > AVG(salary) OVER();
However, when you run this query, you'll get an error message. You cannot put window functions in
WHERE. Why? The window functions is applied after the rows are selected. If the window functions were in a
WHERE clause, you'd get a circular dependency: in order to compute the window function, you have to filter the rows with
WHERE, which requires to compute the window function.