I have the below query in Siddhi
(WSO2 Stream Processor) where I am trying to get the final sum by county when I send stream of 10 events (4 events for ABC, 6 events for CDE). But, with the below query I get all the 10 records with sum of the previous event in the table (total I see 10 records in the table).
My expected output should be as below:
ABC 13456 34521
CDE 23789 65342
Please help me to get the final entry in the table instead all the 10 entries.
Siddhi Query:
partition with (county of TIVStream )
begin
from TIVStream
select county, sum(tiv_2011) as Sum2011 , sum(tiv_2012) as Sum2012
insert events into TIV
end;
Thank you, Divya