Postgresql Min Max. Postgresql max function is an aggregate function that returns the maximum value in a set of values. For example there are aggregates to compute the count sum avg average max maximum and min minimum over a set of rows.
If we want to get the minimum salary and deduction from employee table the following sql can be used. Postgresql max function is an aggregate function that returns the maximum value in a set of values. The above given postgresql statement will produce the following result max 85000 1 row you can find all the records with maximum value for each name using the group by clause as follows testdb select id name max salary from company group by id name.
Select min salary minimum salary min deduction minimum deduction from employee.
The following example uses the min and max function to find the shortest and longest films by category. For example there are aggregates to compute the count sum avg average max maximum and min minimum over a set of rows. The above given postgresql statement will produce the following result. An aggregate function computes a single result from multiple input rows.