ARRAY_SLICE

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Returns an array constructed from a specified subset of elements of the input array.

Syntax

ARRAY_SLICE( <array> , <from> , <to> )

Parameters

NameRequiredDescription
arrayrequiredThe source array of which a subset of the elements are used to construct the resulting array.
fromrequiredA position in the source array. The position of the first element is 0. Elements from positions less than from aren’t included in the resulting array.
torequiredA position in the source array. Elements from positions equal to or greater than to are not included in the resulting array.

Returns

This function returns a value of type ARRAY. Returns NULL if the any argument is NULL, including the input array, from, or to.

Usage notes