Rows Since Changed Function; Considerations For Rows Since Changed; Counting The Rows; Examples Of Rows Since Changed - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

--- 5 row(s) selected.

ROWS SINCE CHANGED Function

The ROWS SINCE CHANGED function is a sequence function that returns the number of rows
counted since the specified set of values last changed in the intermediate result table ordered by
a SEQUENCE BY clause in a SELECT statement. See
ROWS SINCE CHANGED is a Neoview SQL extension.
ROWS SINCE CHANGED (column-expression-list)
column-expression-list
is a comma-separated list that specifies a derived column list determined by the evaluation
of the column expression list. ROWS SINCE CHANGED returns the number of rows counted
since the values of column-expression-list changed.

Considerations for ROWS SINCE CHANGED

Counting the Rows

For the first row in the intermediate result table, the count is 1. For subsequent rows that have
the same value for column-expression-list as the previous row, the count is 1 plus the
count in the previous row. For subsequent rows that have a different value of
column-expression-list than the previous row, the count is 1.

Examples of ROWS SINCE CHANGED

Return the number of rows since the value of I1 last changed:
SELECT ROWS SINCE CHANGED (I1)
FROM mining.seqfcn
SEQUENCE BY TS;
Return the number of rows since the value of I1 and ts last changed:
SELECT ROWS SINCE CHANGED (I1, TS)
FROM mining.seqfcn
SEQUENCE BY TS;

RPAD Function

The RPAD function pads the right side of a string with the specified string.
RPAD is a Neoview extension.
RPAD (str, len [,padstr])
str
can be an expression. See
len
can be an expression but must be an integral value. If len is equal to the length of the string,
no change is made. If len is smaller than the string size, the string is truncated.
pad-character
can be an expression and may be a string.
Examples of RPAD
This function returns 'kite '.
394
SQL Functions and Expressions
"Character Value Expressions" (page
"SEQUENCE BY Clause" (page
208).
268).

Advertisement

Table of Contents
loading

Table of Contents