Updated on 2026-11-06 GMT+08:00

stddev_pop

Function

The stddev_pop function is used to return the population standard deviation of the specified column.

Syntax

stddev_pop(col)

Parameters

Parameter

Mandatory

Description

col

Yes

A column with numeric data type. Other types return NULL.

Return Values

Returns a value of type DOUBLE.

Examples

  • Calculate the population standard deviation of all items inventory. Example command:
    select stddev_pop(items) from warehouse; 

    Result:

    _c0        
    91.49358659976605   
  • Used with GROUP BY to group all items by warehouse (warehouseId) and calculate the population standard deviation of items inventory within the same group. Example command:
    select warehouseId, stddev_pop(items) from warehouse group by warehouseId; 

    Result:

    warehouseId _c1        
    city1    1.4142135623730951   
    city2    11.180339887498949   
    city3    81.64965809277261