Hello
I have an application that gathers and stores data over time. Because of the applications reliance on the network and other functions the
data is gathered at irregular intervals.
The sample data is like this with:
Time_stamp
2010-11-16 10:30:00
2010-11-16 10:31:00
2010-11-16 10:32:00
2010-11-16 10:33:00
2010-11-16 10:33:44
2010-11-16 10:36:44
2010-11-16 10:37:44
2010-11-16 10:41:44
2010-11-16 10:43:44
2010-11-16 10:44:44
2010-11-16 10:55:44
2010-11-16 10:57:44
2010-11-16 10:58:44
The Requirement is
I would like to summarize the data in last 5 min interval from the give time ,assume if i have pass the timestamp 2010-11-16 10:48:44 the output should be
Eg.
Record has to be counted between
2010-11-16 10:34:00 to 2010-11-16 10:38:00
2010-11-16 10:39:00 to 2010-11-16 10:43:00
2010-11-16 10:44:00 to 2010-11-16 10:48:00
Expected Result
interval_alias cnt
------------------- ----
2010-11-16 10:38:00 2
2010-11-16 10:43:00 2
2010-11-16 10:48:00 1
Kindly help me in getting the above result.
Thanks,
V_B