How do I produce a time interval query in SQLite?

reerveenera

New Member
I have an events based table that I would like to produce a query, by minute for the number of events that were occuring.For example, I have an event table like:\[code\]CREATE TABLE events ( session_id TEXT, event TEXT, time_stamp DATETIME)\[/code\]Which I have transformed into the following type of table:\[code\]CREATE TABLE sessions ( session_id TEXT, start_ts DATETIME, end_ts DATETIME, duration INTEGER);\[/code\]Now I want to create a query that would group the sessions by a count of those that were active during a particular minute. Where I would essentially get back something like:\[code\]TIME_INTERVAL ACTIVE_SESSIONS------------- ---------------18:00 118:01 518:02 318:03 018:04 2\[/code\]
 
Top