MIN()

Aggregate. Returns the minimum value of a given expression over multiple rows.

Syntax

MIN( expression )
Data Types

Return

expression

Integer

Integer

Long

Long

Float

Float

Interval

Interval

Timestamp

Timestamp

String

String

BLOB

BLOB

Usage

DISTINCT is valid, but has no effect, because the minimum of the distinct values is the same as the minimum of all values.

Example

The following example calculates the minimum value of the Price column over the last five minutes:

INSERT INTO OutStream
SELECT MIN(Trades.Price)
FROM Trades KEEP 5 MINUTES;