ARRAY_INTERSECTION

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Returns an array that contains the matching elements in the two input arrays. The function is NULL-safe, meaning it treats NULLs as known values for comparing equality.

Syntax

ARRAY_INTERSECTION( <array1> , <array2> )

Parameters

NameRequiredDescription
array1requiredAn array that contains elements to be compared.
array2requiredAn array that contains elements to be compared.

Returns

This function returns an ARRAY that contains the elements of the input arrays that match. If no elements overlap, the function returns an empty array. If one or both arguments are NULL, the function returns NULL. The order of the values within the returned array is unspecified.

Usage notes

See also

Referenced by