AVG()

Scalar. Returns the average value of multiple expressions.

Syntax

AVG( expression, expression [, ...] )
Parameters

expression

You must pass at least two parameters, all of the same type. If any parameter is NULL, the function returns NULL.

Data Types

Return

expression

Float

Integer

Long

Float

Interval

Interval

Timestamp

Timestamp

Example

The following example calculates the average of three columns from the stream Orders:

INSERT INTO OutStream
SELECT AVG(Orders.line1price, Orders.line2price, Orders.line3Price)
FROM Orders;