Mailing List
Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
ODBC - ODBC with the MySQL Connector/ODBC driver
Perl - Perl support for MySQL with DBI and DBD::mysql
MySQL++ - Programming with the C++ API to MySQL
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Great QUERY question

Great QUERY question

2004-03-16       - By Victoria Reznichenko

 Back
Reply:     1     2  

"JR Bullington " <bullijr@(protected) > wrote:
> 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.

There are STD()/STDDEV() functions in the MySQL:
    http://www.mysql.com/doc/en/GROUP-BY-Functions.html


--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ Victoria.Reznichenko@(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/mysql?unsub=mysql @(protected)