Name

STDDEV_POP

Synopsis

Use STDDEV_POP to find the population standard deviation within a group of numeric values.

SQL2003 Syntax

STDDEV_POP( numeric_expression )

DB2 and MySQL

Use the STDDEV function. In DB2 and MySQL, STDDEV returns the population standard deviation.

PostgreSQL

This platform does not provide a function to compute population standard deviation.

Oracle

Oracle supports the standard syntax and the following analytic syntax:

STDDEV_POP (numeric_expression) OVER (window_clause)

For an explanation of the window_clause, see the section later in this chapter titled Section 4.3.

SQL Server

Use the STDEVP function.

Example

The following example computes the population standard deviation for the values 1, 2, and 3:

SELECT * FROM test;
         X
----------
         1
         2
         3
SELECT STDDEV_POP(x) FROM test;
STDDEV_POP(X)
-------------
   .816496581

Get SQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.