Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks SQL
Databricks Runtime
Returns true if array
contains value
.
array_contains(array, value)
array
: An ARRAY to be searched.value
: An expression with a type sharing a least common type with thearray
elements.
A BOOLEAN.
If value
is NULL
, the result is NULL
.
If any element in array
is NULL
, the result is NULL
if value
is not matched to any other element.
> SELECT array_contains(array(1, 2, 3), 2);
true
> SELECT array_contains(array(1, NULL, 3), 2);
NULL
> SELECT array_contains(array(1, 2, 3), NULL);
NULL