Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Averaging Query on Logging Table
In article <Cjcr7.4$6f3.10675_at_news0.optus.net.au>, "Matt says...
>
>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.
>
>
select username, avg(cnt)
from (select username, count(*) cnt
from t group by username, trunc(date_logged) )
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Sun Sep 23 2001 - 16:30:45 CDT