Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL average AVG function

Status
Not open for further replies.

Gwizard

Programmer
Mar 1, 2004
2
GB
I have an access query that computes an average and then finds the max value of each of these averages using stored procedures.

how do I do this as the version of sql I am using now says that MAX(AVG(hits)) is invalid.

SELECT member,memtype,avg(hits)
FROM MEMBERS
GROUP BY member,memtype

How do I work out the max average and ideas
 
Code:
select max(blast)
from (SELECT avg(hits) as blast
FROM MEMBERS
GROUP BY member,memtype) as dt
 
Didn't quite work I am using sql anywhere,I will have to fiddle around with the syntax.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top