Link Search Menu Expand Document

STDDEV_SAMP

Computes the standard deviation of a sample consisting of a numeric expression.

Syntax

STDDEV_SAMP(<expr>)
Parameter Description
<expr> Any column with numeric values or an expression that returns a column with numeric values.

Example

For this example, we’ll create a new table num_test as shown below:

CREATE DIMENSION TABLE IF NOT EXISTS num_test (num INT);


INSERT INTO
	num_test
VALUES
	(1),
	(7),
	(12),
	(30),
	(59),
	(76),
	(100);

STDDEV_SAMP returns the standard deviation for the values.

SELECT
	STDDEV_SAMP(num)
FROM
	num_test

Returns: 38.18251906180054