STDDEV_SAMP() GROUP BY ...

All functions > GROUP BY > STDDEV_SAMP() GROUP BY ...

Returns the sample standard deviation of the values in the group.

Syntax

STDDEV_SAMP(expr)
 [ FILTER (WHERE condition) ]
  [ GROUP BY feature [, feature ...] ]

Notes

  • Computes the sample standard deviation (divides by N-1, Bessel's correction)
  • NULL values are excluded from the calculation
  • Returns NULL if all values are NULL or group has fewer than 2 values

Examples

FeatureQL
SELECT
    f1 := ZIP(ARRAY[1, 2, 3, 4] AS value).TRANSFORM(SELECT STDDEV_SAMP(value)).UNWRAP_ONE() -- Sample standard deviation
;
Result
f1 VARCHAR
1.2909944487358056

Last update at: 2026/05/26 17:22:09