Tim
Tim

Reputation: 113

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

All Columns have a timestamp from that I can get that information. I tried already this but I don't get it to work!!

Upvotes: 2

Views: 125

Answers (2)

bastian schmick
bastian schmick

Reputation: 474

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;

Upvotes: 4

Andre Backlund
Andre Backlund

Reputation: 6943

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.

Upvotes: 3

Related Questions