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

ParameterTypeRequiredDescription
arrayARRAYBIGINTYesThe input array from which to remove elements
elementBIGINTYesThe 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

Examples

Last update at: 2025/10/13 10:23:46