STDEVP
Syntax
SELECT STDEVP(stlpec) FROM tabulka;
Popis
Príkaz jazyka SQL
The aggregate function STDEVP computes the standard deviation for the population of all the values listed in a column or expression.
STDEVP is used when the group of numbers being evaluated is complete - it's the entire population of values. In this case, the 1 is NOT subtracted and the denominator for dividing the sum of squared deviations is simply N itself, the number of observations ( a count of items in the data set ). Technically, this is referred to as "biased." Remembering that the P in STDEVP stands for "population" may be helpful. Since the data set is not a mere sample, but constituted of ALL the actual values, this standard deviation function can return a more precise result.
Príklad
> SELECT * FROM employee;
id first_name last_name salary start_Date region city managerid
------ ---------- ---------- ------------ ---------- -------- ------------- -----------
1 Jason Martin 5890.00 2005-03-22 North Vancouver 3
2 Alison Mathews 4789.00 2003-07-21 South Utown 4
3 James Smith 6678.00 2001-12-01 North Paris 5
4 Celia Rice 5567.00 2006-03-03 South London 6
5 Robert Black 4467.00 2004-07-02 East Newton 7
6 Linda Green 6456.00 2002-05-19 East Calgary 8
7 David Larry 5345.00 2008-03-18 West New York 9
8 James Cat 4234.00 2007-07-17 West Regina 9
9 Joan Act 6123.00 2001-04-16 North Toronto 10
(9 rows affected)
SELECT STDEVP(salary) StandDevSalary FROM employee;
StandDevSalary
------------------------
819.58405590357631
id first_name last_name salary start_Date region city managerid
------ ---------- ---------- ------------ ---------- -------- ------------- -----------
1 Jason Martin 5890.00 2005-03-22 North Vancouver 3
2 Alison Mathews 4789.00 2003-07-21 South Utown 4
3 James Smith 6678.00 2001-12-01 North Paris 5
4 Celia Rice 5567.00 2006-03-03 South London 6
5 Robert Black 4467.00 2004-07-02 East Newton 7
6 Linda Green 6456.00 2002-05-19 East Calgary 8
7 David Larry 5345.00 2008-03-18 West New York 9
8 James Cat 4234.00 2007-07-17 West Regina 9
9 Joan Act 6123.00 2001-04-16 North Toronto 10
(9 rows affected)
SELECT STDEVP(salary) StandDevSalary FROM employee;
StandDevSalary
------------------------
819.58405590357631
Pozri aj
StDev