Runningvariance Function; Examples Of Runningvariance - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

RUNNINGVARIANCE Function

The RUNNINGVARIANCE function is a sequence function that returns the variance of nonnull
values of a column up to and including the current row of an intermediate result table ordered
by a SEQUENCE BY clause in a SELECT statement. See
RUNNINGVARIANCE is a Neoview SQL extension.
RUNNINGVARIANCE (column-expression)
column-expression
specifies a derived column determined by the evaluation of the column expression.
RUNNINGVARIANCE returns the variance of nonnull values of column-expression up
to and including the current row.

Examples of RUNNINGVARIANCE

Return the variance of nonnull values of I1 up to and including the current row:
SELECT RUNNINGVARIANCE (I1) AS VARIANCE_I1
FROM mining.seqfcn
SEQUENCE BY TS;
VARIANCE_I1
-------------------------
0.00000000000000000E+000
2.41098840499999960E+008
2.19099696999999968E+008
1.57851953666666640E+008
1.19374201299999980E+008
--- 5 row(s) selected.
Note that you can use the CAST function for display purposes. For example:
SELECT CAST(RUNNINGVARIANCE (I1) AS DEC (18,3))
FROM mining.seqfcn
SEQUENCE BY TS;
(EXPR)
--------------------
241098840.500
219099697.000
157851953.666
119374201.299
--- 5 row(s) selected.
402
SQL Functions and Expressions
.000
"SEQUENCE BY Clause" (page
268).

Advertisement

Table of Contents
loading

Table of Contents