Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Returns a new array with all instances of a specified element removed.
Syntax
array_remove(<array>, <element>)
Arguments
Required
<array>: The source array.<element>: The value to remove.
Returns
Returns an array with all occurrences of the specified element removed.
Considerations
- Removes all occurrences of the element, not just the first.
- If the element isn't found, the original array is returned unchanged.
Examples
Remove All Occurrences
Remove all instances of a value from an array.
SELECT array_remove(array[1, 2, 1, 3], 1) AS result;
Returns array[2, 3], removing both occurrences of 1.