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.
| ||A series of arrays to be analyzed for mutual elements.|
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 ]) )