Skip to main content

min (Function)

This function returns the smaller value of p1 and p2.

Syntax

<DOUBLE> math:min(<INT|LONG|FLOAT|DOUBLE> p1, <INT|LONG|FLOAT|DOUBLE> p2)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
p1One of the input values that are to be compared in order to find the smaller value.INT LONG FLOAT DOUBLENoYes
p2The input value that is to be compared with p1 in order to find the smaller value.INT LONG FLOAT DOUBLENoYes

Example 1

CREATE STREAM InValueStream (inValue1 double, inValue2 int);

@info(name = 'findMinValue')
INSERT INTO OutMediationStream
SELECT math:min(inValue1, inValue2) AS minValue
FROM InValueStream;

The query compares the given input values inValue1 and inValue2 from InValueStream, and directs the smaller value to the output stream OutMediationStream. For example, min(123.67d, 91) returns 91.