|
|
"Orchid XP v7" <voi### [at] devnull> wrote in message
news:47d19c72$1@news.povray.org...
> Darren New wrote:
> > Or, to clarify. Count the number of sessions that *ended*. Much easier
> > than counting the number of sessions that started. Finding the end of a
> > session is finding the row where there's no row with a greater timestamp
> > but within 10 minutes of this timestamp.
>
> Care to write an SQL statement? ;-)
Very rough and probably wrong. It's late and I'm not going to test this
SELECT Stuff FROM someTable a
WHERE not exists
(SELECT 1 FROM SomeTable b where DATEDIFF ('mi',a.timestamp,b.timestamp)
between 0 and 10 AND a.UserID = b.UserID and a.HitID != b.HitID)
That should give all hits that don't have another hit with the same user ID
in the next 10 minutes.
It's not particuarly efficient, but I don't care right now.
Post a reply to this message
|
|