Skip to main content
This function takes an array of arbitrary type as input, and produces an integer array of the same length containing increasing numbers. The returned array starts with value one. Every successive element is incremented by one, it holds that array[i] = array[i - 1] + 1. NULLs contained in the parameter array are treated like any other value, and result in a non-null element in the returned array. If the parameter array is NULL, then the function also returns NULL.

Syntax

Parameters

Return Type

ARRAY(INT)

Example

The following example returns an array with values one to four:

Rows: 1Execution time: 6.81ms

The array passed to the function can contain arbitrary types:

Rows: 1Execution time: 5.84ms

NULL values are still reflected in the returned result:

Rows: 1Execution time: 5.10ms

If the array passed to the function is NULL, so is the result:

Rows: 1Execution time: 5.51ms