Description: Returns the maximum value by partition.

MAX (<distinct | ALL> expression) OVER (<analytic clause>)
conn oe/oe
SELECT manager_id, last_name, salary
  SELECT manager_id, last_name, salary,
  MAX(salary) OVER (PARTITION BY manager_id) AS rmax_sal
  FROM employees)
WHERE salary = rmax_sal;

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.