Non puoi semplicemente usare la finestra per selezione
Qualcosa come
SELECT name,
first_value() OVER (partition by name order by date) as f,
last_value() OVER (partition by name order by date) as l
from table1
Anche dal tuo riferimento puoi farlo in questo modo
SELECT sum(salary) OVER w, avg(salary) OVER w
FROM empsalary
WINDOW w AS (PARTITION BY depname ORDER BY salary DESC)