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

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-133
Examples of RUNNINGSTDDEV
Return the standard deviation of nonnull values of I1 up to and including the
current row:
SELECT RUNNINGSTDDEV (I1) AS STDDEV_I1
FROM mining.seqfcn
SEQUENCE BY TS;
STDDEV_I1
-------------------------
0.00000000000000000E+000
1.55273578080753976E+004
1.48020166531456112E+004
1.25639147428923072E+004
1.09258501408357232E+004
--- 5 row(s) selected.
Note that you can use the CAST function for display purposes. For example:
SELECT CAST(RUNNINGSTDDEV (I1) AS DEC (18,3))
FROM mining.seqfcn
SEQUENCE BY TS;
(EXPR)
--------------------
.000
15527.357
14802.016
12563.914
10925.850
--- 5 row(s) selected.