Skip to main content

min (Aggregate Function)

Returns the minimum value for all the events.

Syntax

<INT|LONG|DOUBLE|FLOAT> min(<INT|LONG|DOUBLE|FLOAT> arg)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
argThe value that needs to be compared to find the minimum value.INT LONG DOUBLE FLOATNoYes

Example

@info(name = 'query1')
INSERT INTO outputStream
SELECT min(temp) AS minTemp
FROM inputStream;

This query, named 'query1', calculates the minimum temperature (minTemp) from the inputStream using the min(temp) function. The resulting minimum temperature is then inserted into the outputStream.

Essentially, this query processes records in the inputStream, calculates the minimum temperature, and then creates new records in the outputStream with the calculated minTemp value.