Monthly Aggregation and Filtering

Aggregate the table with time range filtering, with monthly groupings.

Description

This example shows how to apply monthly aggregation and filtering. The queries below are applying the aggregate functions, to the last 12 months worth of data.

Sample Input

tbl
time col
1416435585 2
1416435586 3
1416435587 5
1416435588 1
... ...

Query


to view this query

Sample Output

day cnt sum
2014-01 31 300
2014-02 33 130
2014-03 13 333
2014-04 23 345
2014-05 91 390
2014-06 13 103
2014-07 42 129
2014-08 31 231
2014-09 65 654
2014-10 87 967
2014-11 36 676
2014-12 94 979