Reference material for ARRAY_INTERSECT function
NULL
values within arrays as known values, as shown in the following examples.
If any of the input argument arrays are themselves NULL
, the function returns NULL
.
Parameter | Description | Supported input types |
---|---|---|
<array> [, ...n] | The argument arrays whose intersection is to be computed. | ARRAY |
ARRAY
of the common type of all input arrays.
The common type is the supertype of the provided array types. For example, the supertype between Array(Int)
and Array(BigInt)
is Array(BigInt)
.
1
:
result (ARRAY(INTEGER)) |
---|
{1} |
colors (ARRAY(TEXT)) |
---|
{crimson,maroon,red} |
ARRAY_SORT
is used to ensure the results are in ascending order:
sorted (ARRAY(INTEGER)) |
---|
{1,3,5} |
NULL
can appear in the intersection, only if it appears in all the argument arrays:
contains_null (ARRAY(INTEGER)) |
---|
{NULL,9} |
unique (ARRAY(INTEGER)) |
---|
{2,1} |
nested (ARRAY(ARRAY(INTEGER))) |
---|
{NULL,{1,2}} |