Skip to main content

ARRAY_REMOVE

Description

Removes all specified elements from an array

Syntax

ARRAY_REMOVE(<arr>, <val>)

Parameters

ParameterDescription
<arr>Corresponding array
<val>Specifying Elements

Return Value

Returns the array after removing all specified elements. If the input parameter is NULL, it returns NULL

Example

SELECT ARRAY_REMOVE(['test', NULL, 'value'], 'value');
+------------------------------------------------+
| array_remove(['test', NULL, 'value'], 'value') |
+------------------------------------------------+
| ["test", null] |
+------------------------------------------------+