Row

HISTORY

HISTORY(field_name, integer)

Selects integer count previous values of field_name into ARRAY. Returns NULL if field_name evaluates to NULL.

The maximum of integer count is 128.

output type:ARRAY

Example:

1
dual(5) | select(i, HISTORY(i, 5));
i history
0 [0]
1 [0, 1]
2 [0, 1, 2]
3 [0, 1, 2, 3]
4 [0, 1, 2, 3, 4]

KEEP

KEEP(field_name)

Returns last non-NULL value of field_name in the resultset. Returns NULL if field_name evaluates to NULL.

output type:the type of field_name argument

Example:

1
dual(5) | select(val:IF(i%3==0,TO_NULL(i),i)) | select(val, KEEP(val));
val keep
NULL NULL
1 1
2 2
NULL 2
4 4

ROWID

ROWID()

Returns row-id of the current row in the resultset. The count starts from 1.

output type:INTEGER

Example:

1
dual(5) | select(ROWID(), i, t, s);
rowid i t s
1 0 2019-09-19 12:34:34.547 +0000 0ho0
2 1 2019-09-19 12:34:34.548 +0000 1ho1
3 2 2019-09-19 12:34:34.549 +0000 2ho2
4 3 2019-09-19 12:34:34.550 +0000 3ho3
5 4 2019-09-19 12:34:34.551 +0000 4ho4