CONTAINS
All functions > ARRAY > CONTAINS
Returns true if the array contains the specified element.
Syntax
CONTAINS(array, element) sql
Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
array | ARRAYBIGINT | Yes | The array to search in |
element | BIGINT | Yes | The 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