currently the query looks like this:
SELECT event_id, intdur FROM event_data where event_time <= datetime('2004-04-07 00:00:00', '+ i minutes')
AND datetime('2004-04-07 00:00:00', '+ i minutes', '- intdur seconds') <= event_time";
but it takes an age to work as I have to run the query 60 times for each hour
I was thinking of creating a seperate table with a row for each minute and then run a query against that table using the minute integer as part of a sub-select against the event table. I have tried but can't get it to work.
so far I get an error: only a single result allowed for a SELECT that is part of an expression
----------------------------------------------
SELECT count(i) from integers60 WHERE (SELECT event_id, intdur from event_data where event_time <= datetime('2004-04-07 10:00:00', '+ i minutes') AND datetime('2004-04-07 10:00:00', '+ i minutes', '+ intdur) <= event_time)
Can some one help?
Lloyd