Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Averaging Query on Logging Table

Re: Averaging Query on Logging Table

From: <catherinedevlin_at_girlgeekmail.com>
Date: 24 Sep 2001 22:55:45 GMT
Message-ID: <9oodlh$vif$1@news.netmar.com>

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)

  )
group by username;

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.
>
>

Received on Mon Sep 24 2001 - 17:55:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US