开发者

How can I count the number of items that where inserted at given time intervall to the DB?

开发者 https://www.devze.com 2023-03-05 05:02 出处:网络
All Columns have a timestamp from that I can get that information. I tried already this but I don\'t g开发者_开发问答et it to work!! if for example you want to group the number of occurences of a row

All Columns have a timestamp from that I can get that information. I tried already this but I don't g开发者_开发问答et it to work!!


if for example you want to group the number of occurences of a row by the hour part of the time stamp, try something like this (MySQL syntax):

select hour(TimeStamp) as interval, count(*) from data group by interval;


Did you try

... WHERE timestamp > 1305211123 AND timestamp < 1305215094

This is for unix timestamp of course, if you have datefield instead it's pretty similar though.

0

精彩评论

暂无评论...
验证码 换一张
取 消