Returns the standard deviation of a set of numbers.
STDDEV ( [ ALL ] expression )
expression Any numeric data type (float, real, or double precision) expression.
NULL Returns null values on one-element input sets in Sybase IQ versions prior to 12.7.
Given this data:
SELECT salary FROM employee WHERE dept_id = 300
salary |
---|
51432.000 |
57090.000 |
42300.000 |
43700.00 |
36500.000 |
138948.000 |
31200.000 |
58930.00 |
75400.00 |
The following statement returns the value 32617.8446712838471:
SELECT STDDEV ( salary ) FROM employee WHERE dept_id = 300
Given this data:
SELECT unit_price FROM product WHERE name = 'Tee Shirt'
name |
unit_price |
---|---|
Tee Shirt |
9.00 |
Tee Shirt |
14.00 |
Tee Shirt |
14.00 |
The following statement returns the value 2.88675134594813049:
SELECT STDDEV ( unit_price ) FROM product WHERE name = 'Tee Shirt'
The formula used to calculate STDDEV is
STDDEV returns a result of data type double precision floating point. If applied to the empty set, the result is NULL.
STDDEV does not support the keyword DISTINCT. A syntax error is returned if DISTINCT is used with STDDEV.
“STDDEV_SAMP function [Aggregate]”
“VARIANCE function [Aggregate]”
Chapter 4, “Using OLAP” in the Sybase IQ Performance and Tuning Guide