[EMAIL PROTECTED] wrote: > > Hi, > > I have some logging data from a webserver in a table and want to do some > analysis. > I infact want to see how many files are requested at one time. > To do this I > SELECT COUNT(time) anz FROM table GROUP BY time ORDER BY anz DESC > This gives me the number of requests at any time. I now want to see the > average number of requests per time. > I thus thought I can use a subselect like > SELECT AVG(SELECT COUNT(time) anz FROM table GROUP BY time) FROM table > > That seems impossible, it in fact simply does not work. > Is it wrong by my design or is it MySQL design not to pass a subselect > to an aggregate function? >
If I've got you right you need: SELECT AVG(anz) FROM (SELECT COUNT(time) anz FROM table GROUP BY time) as table1; -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]