Evaluates all arrays that are provided as arguments and returns an array of any elements that are present in all the arrays. The order of the resulting array may be different than the original arrays. Use
ARRAY_SORT to stipulate a specific order on the results.
|Parameter||Description||Supported input types|
| ||A series of arrays to be analyzed for mutual elements.|| |
ARRAY of the same type as the input arrays
In the example below, the only element that is shared between all three arrays is
SELECT ARRAY_INTERSECT([ 1, 2, 3 ], [ 1, 3 ], [ 2, 3 ])
In this second example below, we are using
ARRAY_SORT to ensure the results are in ascending order.
SELECT ARRAY_SORT( ARRAY_INTERSECT([ 5, 4, 3, 2, 1 ],[ 5, 3, 1 ]) )