Offset Function; Example Of Offset - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

OFFSET Function

The OFFSET function is a sequence function that retrieves columns from previous rows of an
intermediate result table ordered by a SEQUENCE BY clause in a SELECT statement. See
"SEQUENCE BY Clause" (page
OFFSET (column-expression,number-rows [,max-rows])
column-expression
specifies a derived column determined by the evaluation of the column expression.
number-rows
is an SQL numeric value expression of signed data type SMALLINT or INTEGER that specifies
the offset as the number of rows from the current row. If the number of rows exceeds
max-rows, OFFSET returns OFFSET(column-expression,max-rows). If the number of
rows is out of range and max-rows is not specified or is out of range, OFFSET returns null.
The number of rows is out of range if it is larger than the size of the result table, negative, or
NULL.
max-rows
is an SQL numeric value expression of signed data type SMALLINT or INTEGER that specifies
the maximum number of rows of the offset.

Example of OFFSET

Retrieve the I1 column offset by three rows:
SELECT OFFSET (I1,3) AS OFFSET3
FROM mining.seqfcn
SEQUENCE BY TS;
OFFSET3
------------
6215
28174
--- 5 row(s) selected.
Note that the first three rows retrieved display null because the offset from the current row does
not fall within the result table.
438
SQL Functions and Expressions
326). OFFSET is a Neoview SQL extension.
?
?
?

Advertisement

Table of Contents
loading

Table of Contents