try GROUP BY (UNIX_TIMESTAMP(tVH.vDateTime) -
MOD(UNIX_TIMESTAMP(tVH.vDateTime, 300)))

> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: Date Interval Grouping
> Date: Tue, 26 Mar 2002 19:13:44 -0700
>
> Ok here's what I trying to do. I am trying to design a little browser/ip
> tracking page and I need an SQL statement that will allow me to group IPs
> that hit the site in 5 minute intervals (well I just want the interval
thing
> to work cuz I'll prolly want to make this like 30 minutes or a full hour).
> The reason I want this kind of grouping is that if a person hits the page
> constantly for 5 minutes I don't want that to push other relevant IPs down
> the listing. Here's what I have to actually select the data from the
> database.
>
> SELECT tblVisitorHits.vIP, tblVisitorHits.vDateTime, tblBrowser.bVersion
> FROM tblBrowser
> RIGHT JOIN tblVisitorHits ON tblVisitorHits.vBrowser = tblBrowser.bKey
> ORDER BY tblVisitorHits.vDateTime DESC, tblBrowser.bVersion ASC
> LIMIT 0, 50;
>
> // A simple group by I know will not work. but was wondering if there
> // was a way to create a more complex group by that included expressions.
>
> I don't know how one would implement the interval grouping. Any help would
> be graciously accepted.
>
> ~!



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to