SELECT a.time,a.ss,SUM(lt.ss) as cum
FROM zz a JOIN zz lt
ON a.time >= lt.time where a.time BETWEEN 20171201 and 20171231
GROUP BY a.ss
ORDER BY time;
how to query cumulative results in segments. The starting data accumulate from 0. Instead of adding it up over a period of time,
is like the result of the start of 20171201 above. Not 0, but the cumulative result of values from 20171101 to 20171130