阅读背景:

时间间隔SQL查询与MySQL

来源:互联网 

I've got a table in a database that stores log data by time. For one day there can be a million rows in the db. The times are not at any regular interval. It has several indexes, including the time. What I want to do is build a query that will return a set of rows with one row per time interval. For example, I could do a query to return 1 row every 15 minutes for a day. This would return 24*60=96 rows. Each row returned would actually be the nearest row in the db prior to the interval requested (since the data in the database will not equal the requested interval). I've got a table in a database that stores log




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: