This is for those who love a challenge.

I am trying to come up with a query that would calculate the Standard
Deviation and Variance for 15 fields. Although in theory this is easily done
in Access, MySQL does not have the same mathematical calculations that
Access/SQL does.

Here is the query as it stands in Access:

Select avg(Item01) as Item01a, stdev(Item01) as Item01d, avg(Item02) as
Item02a, stdev(Item02) as Item02d, avg(Item03) as Item03a, stdev(Item03) as
Item03d, avg(Item04) as Item04a, stdev(Item04) as Item04d, avg(Item05) as
Item05a, stdev(Item05) as Item05d, avg(Item06) as Item06a, stdev(Item06) as
Item06d, avg(Item07) as Item07a, stdev(Item07) as Item07d, avg(Item08) as
Item08a, stdev(Item08) as Item08d, avg(Item09) as Item09a, stdev(Item09) as
Item09d, avg(Item10) as Item10a, stdev(Item10) as Item10d, avg(Item11) as
Item11a, stdev(Item11) as Item11d, avg(Item12) as Item12a, stdev(Item12) as
Item12d, avg(Item13) as Item13a, stdev(Item13) as Item13d, avg(Item14) as
Item14a, stdev(Item14) as Item14d, avg(Item15) as Item15a, stdev(Item15) as
Item15d, avg(overallscore) as overa, stdev(overallscore) as overd from
tblFacultyEvalSurgery 

This is for an online grading system that, except for 5 pages, has been
converted over to MySQL and Linux / Apache. 2 of which have this problem.

Avg() is easy, but it's the StDev that I can't get. St Dev is made from
Variance (or the mean), which again is not a function of MySQL.

To view the Variance and StDev formulae,
http://davidmlane.com/hyperstat/A16252.html. If you have any ideas, I will
be working on this for the next few days.

Thanks!

J.R.

Reply via email to