Min

Aggregate Function

Description

Returns the minimum value in a set of values.

Click here to navigate to the PostgreSQL docs page for this syntax.

The function Min() is supported on Snowflake.

Grammar Syntax

MIN(expression)

Sample Source Patterns

PostgreSQL

CREATE OR REPLACE TABLE ranks (
	rank int NOT NULL
);

INSERT INTO ranks
VALUES (6), (5), (8);

SELECT
   MIN(rank)
FROM
   ranks;

Snowflake

CREATE OR REPLACE TABLE ranks (
	rank int NOT NULL
);

INSERT INTO ranks
VALUES (6), (5), (8);

SELECT
   MIN(rank)
FROM
   ranks;

Last updated