Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I would like to know if this is possible. Then if it is possible how would you go about solving it.
Currently we have a database logging an event every few seconds. We would like this rate to countinue because it is needed in other business areas, but for our business area we do not need data logged this often.
Instead we would like a SQL statement that would pull a data entry every minute. So for example if the time stamps fall within the range below we would like only one value recorded per the below series.
2009-08-21 14:00:29.527
2009-08-21 14:00:40.157
2009-08-21 14:00:41.460
2009-08-21 14:00:47.670
2009-08-21 14:00:48.970
2009-08-21 14:00:57.683The SQL statement would need to contain this logic. A script may be better? As stated above I do not know if this is possible or how one would go about doing this.
Let me know if you have any more questions or thoughts on this matter.
Thanks.

It would depend on the database, but your solution would probably be based on SQL's "GROUP BY" function and whatever date/time functions your database provides.

Yes it is more than that.
I would need a SQL statement that can count 'intervals' of a minute time period.
So for example if an event occurred at:
8:09.32
8:09.52
8:10.17Only two time stamps would be recorded out of the given series.
I was thinking a stored procedure or script function but I am unsure of how to approach it.
Thanks for your help thus far.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |