PostgreSQL MIN() Function Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The MIN() function in PostgreSQL is an essential aggregate function that returns the minimum value in a set of values. This function is highly useful in various data analysis and reporting tasks, allowing you to quickly identify the smallest values in your datasets. Let us better understand the MIN() Function in PostgreSQL to better understand the concept.SyntaxMIN(expression)Where 'expression' represents the column or expression from which you want to find the minimum value.PostgreSQL MIN() Function ExamplesLet us take a look at some of the examples of the MIN() Function in PostgreSQL to better understand the concept. For example, we will be using the sample database (ie, dvdrental).Example 1: Finding the Minimum Payment AmountThe following query retrieves the smallest payment amount recorded in the 'payment' table.Query:SELECT MIN(amount)FROM payment;Output:Explanation: This query scans the 'amount' column in the 'payment' table and returns the minimum value, which represents the lowest payment made by any customer.Example 2: Minimum Payment Per CustomerThe next example shows how to find the smallest payment made by each customer. This involves grouping the results by 'customer_id'.Query:SELECT customer_id, MIN(amount)FROM paymentGROUP BY customer_id;Output:Explanation: In this query, 'customer_id' is used to group the payments. The MIN(amount) function finds the smallest payment for each customer within these groups.Important Points About PostgreSQL MIN() FunctionThe MIN() function computes the minimum value over a specified set of values, which can be an entire table or a subset defined by a WHERE clause.MIN() can be effectively combined with GROUP BY to find minimum values within groups, and with HAVING to filter groups based on aggregate conditions.Although MIN() operates on a single column, you can include multiple MIN() functions in a single query to find minimum values of different columns.MIN() ignores NULL values in the computation. Comment More info R rajukumar19 Follow Improve Article Tags : PostgreSQL postgreSQL-aggregate-functions Explore BasicsPostgreSQL Tutorial8 min readWhat is PostgreSQL - Introduction2 min readInstall PostgreSQL on Windows2 min readInstall PostgreSQL on Mac3 min readDatabase OperationsPostgreSQL - Create Database5 min readPostgreSQL - Loading a Database3 min readPostgreSQL ALTER DATABASE3 min readPostgreSQL - Rename Database4 min readPostgreSQL - Show Databases3 min readData TypesPostgreSQL - Data Types5 min readPostgreSQL - Boolean Data Type4 min readPostgreSQL - CHAR Data Type5 min readPostgreSQL - VARCHAR Data Type3 min readPostgreSQL - NUMERIC Data Type5 min readPostgreSQL - Date Data Type4 min readPostgreSQL - TIME Data Type4 min readPostgreSQL - JSON Data Type4 min readPostgreSQL - CREATE DOMAIN3 min readQuerying TablesPostgreSQL - SELECT3 min readPostgreSQL - ORDER BY clause2 min readPostgreSQL - WHERE clause6 min readPostgreSQL FETCH Clause4 min readPostgreSQL - IN operator4 min readPostgreSQL - HAVING clause4 min readPostgreSQL - GROUP BY clause4 min readPostgreSQL - LIKE operator5 min readPostgreSQL - BETWEEN Operator3 min readTable OperationsPostgreSQL - CREATE TABLE5 min readPostgreSQL - SELECT INTO4 min readPostgreSQL - CREATE SEQUENCE4 min readPostgreSQL - ALTER TABLE6 min readPostgreSQL - ADD COLUMN4 min readPostgreSQL - DROP COLUMN2 min readPostgreSQL - Rename Table2 min readPostgreSQL - DROP TABLE5 min readPostgreSQL - TRUNCATE TABLE4 min readPostgreSQL - Copy a Table3 min readPostgreSQL - Comparing Tables3 min readPostgreSQL - Show Tables4 min readModifying DataPostgreSQL - INSERT4 min readPostgreSQL - Insert Multiple Values in Various Rows3 min readPostgreSQL UPDATE Statement5 min readPostgreSQL - DELETE4 min readPostgreSQL - Upsert4 min readConditionalsPostgreSQL - CASE3 min readPostgreSQL COALESCE5 min readPostgreSQL - NULLIF() Function4 min readPostgreSQL - CAST3 min readControl FlowPostgreSQL - IF Statement5 min readPostgreSQL - CASE Statement4 min readPostgreSQL - Loop Statement3 min readPostgreSQL - While Loops4 min readPostgreSQL - Exit Statement3 min readPostgreSQL - Continue3 min readTransactions & ConstraintsPostgreSQL - Transactions4 min readPostgreSQL - COMMIT4 min readPostgreSQL - Primary Key4 min readPostgreSQL - Foreign Key5 min readPostgreSQL - CHECK Constraint2 min readPostgreSQL - UNIQUE Constraint3 min readPostgreSQL - NOT NULL Constraint3 min readJOINS & SchemasPostgreSQL - Joins5 min readPostgreSQL - LEFT JOIN5 min readPostgreSQL - INNER JOIN2 min readPostgreSQL - FULL OUTER JOIN4 min readPostgreSQL - SELF JOIN4 min readPostgreSQL - Schema5 min readPostgreSQL - CREATE SCHEMA5 min readPostgreSQL - DROP SCHEMA4 min readPostgreSQL - ALTER SCHEMA3 min read Like