Skip to main content

ARRAY_STDDEV_SAMP

Computes the sample standard deviation of numeric array values. NULL items are ignored; non-numeric entries raise an error.

Syntax

ARRAY_STDDEV_SAMP(<array>)

Return Type

Floating-point.

Examples

SELECT ARRAY_STDDEV_SAMP([2, 4, 4, 4, 5, 5, 7, 9]) AS stddev_samp;

┌─────────────┐
│ stddev_samp │
├─────────────┤
2.138089935299395
└─────────────┘
SELECT ARRAY_STDDEV_SAMP([1.5, 2.5, NULL, 3.5]) AS stddev_samp_null;

┌─────────────────┐
│ stddev_samp_null │
├─────────────────┤
1
└─────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today