Link Search Menu Expand Document

ARRAY_REVERSE

Returns an array of the same size as the original array, with the elements in reverse order.

Syntax

ARRAY_REVERSE(<arr>)
Parameter Description
<arr> The array to be reversed.

Example

SELECT
	ARRAY_REVERSE([ 1, 2, 3, 6 ]) AS res;

Returns: 6,3,2,1