The query basically takes your hour worth of results and groups it by
hour and 5 minute block with a count of each block.

your result would look like:

Hour   Minute   Hits
1      5        22
1      10       15
1      15       7
1      20       32

and so on ...

Are those the results that you were looking for or did I miss
something?

Also just a note: If you have named your database column datetime it
may cause a problem. I think it might be a reserved name in MySQL. I'm
not really sure of this, but I think I remember having a problem with
that in the past.

On Feb 10, 10:19 pm, Adam Knott <[email protected]> wrote:
> I'm not sure if this syntax is exactly right, but would something like this
> work?
>
> SELECT HOUR(datetime) AS myHour, FLOOR(MINUTE(datetime) / 5) * 5 AS
> myMinute, count(hit_id) AS myHits
> from tbl_dns_hits
> where WHERE (dns_id = '#dns_lookup.dns_id#') and (dns_hit_datetime between
> #sixty_previous# and #now()#)
> group by myHour, myMinute

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to