Skip to main content

ARRAY_PUSHFRONT

Description​

Add value to the beginning of the array

Syntax​

ARRAY_PUSHFRONT(<arr>, <value>)

Parameters​

ParameterDescription
<arr>Corresponding array
<value>Value to be added

Return Value​

Returns the array after adding value

Example​

SELECT ARRAY_PUSHFRONT([1, 2], 3),ARRAY_PUSHFRONT([3, 4], 6);
+----------------------------+----------------------------+
| array_pushfront([1, 2], 3) | array_pushfront([3, 4], 6) |
+----------------------------+----------------------------+
| [3, 1, 2] | [6, 3, 4] |
+----------------------------+----------------------------+