Let’s say i insert multiple series data for a symbol “XXC”, with interval of 1000 (1 second), is there a way to query the data using range, let’s say 5min, 15min, 1h .e.t.c
WITH range_start AS (STR_TO_MILLIS ("2013-07-01", "YYYY-MM-DD")),
range_end AS (STR_TO_MILLIS ("2013-08-31", "YYYY-MM-DD"))
SELECT minutes, AVG(t._v0) AS average
FROM mycollection AS d
UNNEST _timeseries(d, {"ts_ranges": [range_start, range_end]}) AS t
WHERE d.ticker = 'XXC'
AND (d.ts_start <= range_end AND d.ts_end >= range_start)
GROUP BY IDIV(t._t, 1000*60) AS minutes;