ARRAYS_OVERLAP
Descriptionβ
Determine whether the left and right arrays contain common elements
Syntaxβ
ARRAYS_OVERLAP(<left>, <right>)
Parametersβ
Parameter | Description |
---|---|
<left> | The array to be judged |
<right> | The array to be judged |
Return Valueβ
Returns the judgment result: 1: left and right arrays have common elements; 0: left and right arrays do not have common elements; NULL: left or right array is NULL; or any element in left and right array is NULL
Exampleβ
SELECT ARRAYS_OVERLAP(['a', 'b', 'c'], [1, 2, 'b']);
+--------------------------------------------------+
| arrays_overlap(['a', 'b', 'c'], ['1', '2', 'b']) |
+--------------------------------------------------+
| 1 |
+--------------------------------------------------+