ReferenceSQL ReferenceAggregate Functions

stddevSampStable

The result is equal to the square root of varSamp.

This page describes the RawTree engine binary used to generate this reference. It does not define Query API support. Descriptions retain upstream ClickHouse terminology. See SQL interface scope.

The result is equal to the square root of varSamp. Unlike stddevSamp this function uses a numerically stable algorithm. It works slower but provides a lower computational error.

Syntax

stddevSampStable(x)

Arguments

Returned value

Returns the square root of sample variance of x. Float64

Examples

Basic usage

DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data
(
    population UInt8,
)
ENGINE = Log;

INSERT INTO test_data VALUES (3),(3),(3),(4),(4),(5),(5),(7),(11),(15);

SELECT
    stddevSampStable(population)
FROM test_data;
┌─stddevSampStable(population)─┐
│                            4 │
└──────────────────────────────┘

Introduced in version 1.1.0.