Skip to main content
Obtains the position of an element in an array.

Syntax

Parameters

  • any_array: the array to be searched.
  • any_element: an expression that matches the element in an array.

Return value

Returns the position of the specified element if the element can be found in the specified array and returns 0 if the element cannot be found in the array.

Examples

  • Example 1: Obtain the position of an element in an array.
  • Example 2: Obtain the position of NULL in an array.
  • Example 3: Obtain the position of a sub-array in a multi-dimensional array. A position can be returned only when a sub-array that consists of the same elements in the same order as the specified sub-array can be found in the multi-dimensional array.

Keywords

ARRAY_POSITION, ARRAY