STDDEV_SAMP() OVER ...
All functions > WINDOW FUNCTION > STDDEV_SAMP() OVER ...
Returns the sample standard deviation over the window frame.
Syntax
STDDEV_SAMP(expr) OVER ([PARTITION BY expr [, ...]] [ORDER BY sort_item [, ...]] [ROWS|RANGE|GROUPS frame])
Notes
- Computes sample standard deviation (divides by N-1) over a window of rows
- NULL values are ignored in the calculation
See also
Examples
FeatureQL
SELECT
f1 := ZIP(ARRAY[1,2,3] AS id, ARRAY[5.0E0,5.0E0,5.0E0] AS x).TRANSFORM(SELECT STDDEV_SAMP(x) OVER (ORDER BY id ASC)).UNWRAP() -- Sample std dev needs at least two rows
;Result
| f1 ARRAY |
|---|
| [null, 0.00, 0.00] |