ARRAY_REMOVE
All functions > ARRAY > ARRAY_REMOVE
Returns an array with all occurrences of the specified element removed.
Syntax
ARRAY_REMOVE(array, element)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
array | ARRAYBIGINT | Yes | The input array from which to remove elements |
element | BIGINT | Yes | The element to remove from the array |
Returns
A new array with all occurrences of the specified element removed
Notes
- Removes ALL occurrences of the specified element
- Returns a sorted array (implementation-dependent)
- Preserves relative order of remaining elements
- Returns empty array if all elements are removed
- Can be used to remove NULL values from arrays