AVG()

Aggregate. Returns the average value of an expression, calculated over the rows in a window

Syntax

AVG( [DISTINCT] expression )
Parameter

expression

 
Data Types

Return

expression

Float

Integer

Long

Float

Interval

Interval

Timestamp

Timestamp

Example

The following example calculates the average of the Price column from the Trades stream over the last 5 minutes:

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