Let's say that my first column is time. What I want is to be able to count the rows grouping them by an arbitrary time range, for instance: by day, by hour, by 20 minutes intervals, by 15 seconds etc.
Asked
Active
Viewed 62 times
1 Answers
0
Convert the timestamp into some appropriate number (here: number of seconds since the Unix epoch), then do an integer division by the number of seconds (which implicitly rounds down):
SELECT ...
GROUP BY strftime('%s', MyDate) / 15 -- or 20*60 etc.

CL.
- 173,858
- 17
- 217
- 259