Mega Code Archive

 
Categories / MSSQL Tutorial / Analytical Functions
 

STDEV() Function is a calculation based on the variance of a numeric range of values

Actually, it's simply the square root of the variance. 8> Create Table MyValues (MyValue Float) 9> GO 1> 2> Insert Into MyValues (MyValue) SELECT 2 3> Insert Into MyValues (MyValue) SELECT 3 4> Insert Into MyValues (MyValue) SELECT 4 5> Insert Into MyValues (MyValue) SELECT 5 6> Insert Into MyValues (MyValue) SELECT 6 7> GO (1 rows affected) (1 rows affected) (1 rows affected) (1 rows affected) (1 rows affected) 1> 2> SELECT VAR(MyValue) FROM MyValues 3> GO ------------------------                      2.5 (1 rows affected) 1> 2> SELECT STDEV(MyValue) FROM MyValues 3> 4> drop table MyValues; 5> GO ------------------------       1.5811388300841898 (1 rows affected)