MEDIAN()

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

Syntax

MEDIAN( [DISTINCT] expression )
Data Types

Return

expression

Float

Integer

Long

Float

Interval

Interval

Timestamp

Example

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

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