ARRAY_CONTAINS

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Returns TRUE if the specified value is found in the specified array.

Syntax

ARRAY_CONTAINS( <value_expr> , <array> )

Parameters

NameRequiredDescription
value_exprrequiredValue to find in array. If array is a semi-structured array, value_expr must evaluate to a VARIANT. If array is a structured array, value_expr must evaluate to a type that is comparable to the type of the array.
arrayrequiredThe array to search.

Returns

This function returns a value of BOOLEAN type or NULL: - The function returns TRUE if value_expr is present in array, including the following cases: When the value_expr argument is NULL and there is a SQL NULL value in the array (undefined). - When the value_expr argument is JSON null and there is a JSON null value in the array (null). - The function returns FALSE if value_expr isn’t present in array, including when the value_expr argument is JSON null and there are no JSON null values in the array. - The function returns NULL if the value_expr argument is NULL and there are no SQL NULL values in the array. For more information about NULL values in arrays, see NULL values.

Usage notes