PostgreSQL – MAX() Function
PostgreSQL MAX() function is an aggregate function that returns the maximum value in a set of values.
The MAX() function can be used with SELECT, WHERE and HAVING clause.
Now let’s look into some examples.For examples we will be using the sample database (ie, dvdrental).
The below query gets us the maximum amount paid by customers in the
The following query gets the largest payment paid by each customer: