Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Averaging Query on Logging Table
Hmm... maybe something along these lines?
select username,
avg(num_logins)
from
(
select count(*) as num_logins, username, trunc(date_logged) from access_log group by username, trunc(date_logged)
The problem with this query is that it doesn't factor in days with zero logins... so you'll have to refine it some. But I have to run - have fun with it!
Good luck!
- Catherine
http://profiles.yahoo.com/arcticturtle
In article <Cjcr7.4$6f3.10675_at_news0.optus.net.au>, Matt Morton-Allen
<m2_at_csu.edu.au> writes:
>Hi All,
>a quick question. I have a logging table ACCESS_LOG with a DATE_LOGGED and a
>USERNAME field that contains one row for each logged action per user. I want
>to find out an average of how many actions are performed by each user each
>day. That is I would like to be able to state that on average X actions are
>performed by each user on a given day.
>
>Has anyone got any tips on how to get started? I am using Oracle 8.1.6.
>
>Matt.
>
>
![]() |
![]() |