Computing.Net > Forums > Programming > SQL Query Every Minute

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL Query Every Minute

Reply to Message Icon

Name: Octopus
Date: August 21, 2009 at 13:22:06 Pacific
OS: WinServ08
CPU/Ram: 4GB
Product: Biostar / CUSTOM
Subcategory: Theory
Comment:

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.683

The 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.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: August 21, 2009 at 14:11:40 Pacific
Reply:

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.


0

Response Number 2
Name: Octopus
Date: August 23, 2009 at 17:35:21 Pacific
Reply:

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.17

Only 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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: SQL Query Every Minute

Access sql query mystery!! www.computing.net/answers/programming/access-sql-query-mystery/12793.html

SQL Query www.computing.net/answers/programming/sql-query/16559.html

SQL Query www.computing.net/answers/programming/sql-query/11590.html