PostgreSQLAggregate FunctionsMAX
MIN

MAXAggregate Functions

STRING_AGG

Returns the maximum value.

Syntax

MAX(expr)

Example

Enter values below to update the example in real time.

department_id
salary
max_salary
employees
SELECT department_id, MAX(salary) AS max_salary
FROM employees
GROUP BY department_id;