This topic is locked

Average on a chart

8/19/2007 2:32:04 PM
PHPRunner General questions
M
mmponline author

I found the following to show chart values in help. (Adapted with my own fields)
select

`fir`,

`course`,

sum(fir) as `Fairways in Regulation`

From `_golfstats`

group by `fir`
How do I change this code to show the average in stead of sum for the above.
What I need:

I want to get a chart that shows the average of fir for each specific course.
Is there a place to get more help on charts as the help has only 2 examples?
Thanks for any help!

Sergey Kornilov admin 8/19/2007

select

`fir`,

`course`,

avg(fir) as `Fairways in Regulation`

From `_golfstats`

group by `fir`


More info on aggregate functions:

http://www.sql-tutorial.com/sql-aggregate-...s-sql-tutorial/