Quick Search:
 
 The Oracle PL/SQL STDDEV_POP Function      [Return To Index] Jump to:  

Term: STDDEV_POP

Definition:
In Oracle PL/SQL, STDDEV_POP is a built in function which returns the population standard deviation of a set of numbers i.e. square root of the population variance for the input number set. It can be used as both an Aggregate and an Analytic function.

Example Syntax:

Aggregate Function:

STDDEV_POP( [ DISTINCT | ALL ] expression )


Analytic Function:

STDDEV_POP( [ DISTINCT | ALL ] expression ) [ OVER ( analytical_clause ) ]


Example Usage:

The SQL statement below returns the population standard deviation of the Quantity field from ORDERS table:

SELECT STDDEV_POP(QTY)
FROM ORDERS;

STDDEV_POP(QTY)
---------------
143.910403


The SQL statement below returns the cumulative population standard deviation of the quantity over the orders against each date.

SELECT DT,STDDEV_POP(QTY) OVER (ORDER BY dt)
FROM ORDERS


DT STDDEV_POP(QTY)OVER(ORDERBYDT)
--------- ------------------------------
20-OCT-10 0
01-NOV-10 75
09-DEC-10 62.3609564
13-JAN-11 138.021737
15-JAN-11 147.105404
16-JAN-11 145.459043
18-JAN-11 143.910403

7 rows selected.



Related Links:

Related Code Snippets:
  • STDDEV_POP - STDDEV_POP computes the population standard deviation and returns the square root of ...
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org