STDDEV_SAMP() GROUP BY ...

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

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

Syntax

Diagram(
  Sequence(
    Terminal("STDDEV_SAMP"),
    Terminal("("),
    NonTerminal("expr"),
    Terminal(")"),
    Choice(0, Skip(),
      Sequence(
        Terminal("FILTER"),
        Terminal("("),
        Terminal("WHERE"),
        NonTerminal("condition"),
        Terminal(")")
      )
    ),
    Choice(0, Skip(),
      Sequence(
        Terminal("GROUP BY"),
        OneOrMore(NonTerminal("feature"), Terminal(","))
      )
    )
  )
)
ParameterTypeRequiredDescription
exprTYesThe numeric expression to compute standard deviation of
conditionBOOLEANNoThe condition to filter the values before aggregation
featureFEATURENoThe features to group by (many features are supported)

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
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19