A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/functions/array_prepend below:

ARRAY_PREPEND | Snowflake Documentation

Reference Function and stored procedure reference Semi-structured and structured data ARRAY_PREPEND
Categories:

Semi-structured and structured data functions (Array/Object)

ARRAY_PREPEND

Returns an array containing the new element as well as all elements from the source array. The new element is positioned at the beginning of the array.

See also:

ARRAY_APPEND , ARRAY_INSERT

Syntax
ARRAY_PREPEND( <array> , <new_element> )

Copy

Arguments
array

The source array.

new_element

The element to be prepended.

Returns

This returns the updated array.

Usage notes Examples

The example below shows that the prepended element is placed at the beginning of the array:

SELECT ARRAY_PREPEND(ARRAY_CONSTRUCT(0,1,2,3),'hello');
+-------------------------------------------------+
| ARRAY_PREPEND(ARRAY_CONSTRUCT(0,1,2,3),'HELLO') |
|-------------------------------------------------|
| [                                               |
|   "hello",                                      |
|   0,                                            |
|   1,                                            |
|   2,                                            |
|   3                                             |
| ]                                               |
+-------------------------------------------------+

Copy


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4