4 messages in com.mysql.lists.mysqlRe: Using avg, min, max functions on ...
FromSent OnAttachments
Graeme B. Davis15 Mar 1999 06:40 
Graeme B. Davis16 Mar 1999 06:44 
Colin McKinnon17 Mar 1999 02:52 
Graeme B. Davis17 Mar 1999 06:46 
Subject:Re: Using avg, min, max functions on a non-numeric field.
From:Graeme B. Davis (Grae@UU.NET)
Date:03/16/1999 06:44:18 AM
List:com.mysql.lists.mysql

Does anyone have any insight on this?  (I tried selecting avg(count(user) but that didn't work :( )

select user, modified, count(user) as count from db where user='graemed' group by modified;

+--------+------------+------------+ | count  | user       | modified   | +--------+------------+------------+ |     20 | graemed    | 1999-02-01 | |     17 | graemed    | 1999-02-02 | |      5 | graemed    | 1999-02-03 | |     24 | graemed    | 1999-02-04 | etc...

I want to get a AVG/MIN/MAX of the count column over all the rows.

Ideas?

Thanks!

Graeme

I have a database such as:

user (char) category (char) modified (date)

I want to get the average number of entries per day (possibly broken down by category, but not necessary) -- how would I do this?

I want this to be done with all users in the db such as

user      average entries       min, max -------   ---------------  ------------- johndoe                 43          8,93

Any suggestions?

Graeme "SQL bum" D. :)