SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-95
MOVINGSTDDEV Function
MOVINGSTDDEV Function
The MOVINGSTDDEV function is a sequence function that returns the standard
deviation of nonnull values of a column in the current window of an intermediate result
table ordered by a SEQUENCE BY clause in a SELECT statement. See SEQUENCE
BY Clause on page 7-18.
MOVINGSTDDEV is an SQL/MX extension.
column-expression
specifies a derived column determined by the evaluation of the column expression.
integer-expression
is an SQL numeric value expression of signed data type SMALLINT or INTEGER
that specifies the current window. The current window is defined as the current row
and the previous (integer-expression - 1) rows.
max-rows
is an SQL numeric value expression of signed data type SMALLINT or INTEGER
that specifies the maximum number of rows in the current window.
Note these considerations for the window size:
The actual value for the window size is the minimum of integer-
expression and max-rows.
If these conditions are met, MOVINGSTDDEV returns the same result as
RUNNINGSTDDEV:
°
The integer-expression is out of range, and max-rows is not
specified. This condition includes the case in which both integer-
expression and max-rows are larger than the result table.
°
The minimum of integer-expression and max-rows is out of range.
In this case, integer-expression could be within range, but max-rows
might be the minimum value of the two and be out of range (for example, a
negative number).
The number of rows is out of range if it is larger than the size of the result
table, negative, or NULL.
MOVINGSTDDEV (column-expression,integer-expression
[,max-rows])