Skip to main content

sum (Aggregate Function)

Returns the sum for all the events.

Syntax

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

QUERY PARAMETERS

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
argThe value that needs to be summed.INT LONG DOUBLE FLOATNoYes

Example 1

    insert into outputStream
select sum(volume) as sumOfVolume
from inputStream;

This returns the sum of volume values as a long value for each event arrival and expiration.