CONTAINS

All functions > ARRAY > CONTAINS

Returns true if the array contains the specified element.

Syntax

CONTAINS(array, element)
sql

Arguments

ParameterTypeRequiredDescription
arrayARRAYBIGINTYesThe array to search in
elementBIGINTYesThe element to check for existence

Returns

TRUE if the element exists in the array, FALSE otherwise

Notes

  • Returns boolean value indicating element presence
  • Uses exact match comparison (case-sensitive for strings)
  • Returns NULL if checking for NULL element
  • Empty arrays always return FALSE
  • More efficient than ARRAY_POSITION for simple existence checks

Examples

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