Please note that we can include the AGG_TIMESTAMP attribute in the select clause. If AGG_TIMESTAMP is in the select statement, the order by AGG_TIMESTAMP clause could be used if the user needs to get the final aggregations in ascending order, based on time. Such a query would look as follows
from TradeSummaryRetrievalStream as b join TradeAggregation as a
on a.symbol == b.symbol
within "2014-02-15 00:00:00 +05:30", "2014-03-16 00:00:00 +05:30"
select AGG_TIMESTAMP, a.symbol, a.total, a.avgPrice
order by AGG_TIMESTAMP
insert into TradeSummaryStream;
Incremental Aggregation Behavior in Single-node Deployment and HA Deployment