ARRAYS_OVERLAP()

All functions > ARRAY > ARRAYS_OVERLAP()

Returns TRUE if any elements are common between the two arrays.

Signatures

Returns: TRUE if arrays share at least one element, FALSE otherwise

ARRAYS_OVERLAP(array1: ARRAY<T>, array2: ARRAY<T>) → BOOLEAN
sql
ParameterTypeRequiredDescription
array1ARRAY<T>YesFirst array to check
array2ARRAY<T>YesSecond array to check

Notes

  • Returns TRUE if arrays have any common elements
  • Returns FALSE if arrays have no common elements
  • Empty arrays return false
  • Uses element equality comparison

See also

Examples

FeatureQL
SELECT
    f1 := ARRAYS_OVERLAP(ARRAY[1, 2], ARRAY[2, 3]), -- Shares element 2
    f2 := ARRAYS_OVERLAP(ARRAY[1, 2], ARRAY[3, 4]), -- Disjoint arrays
    f3 := ARRAYS_OVERLAP(ARRAY[]::BIGINT[], ARRAY[1]) -- Empty array
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEAN
truefalsefalse

Last update at: 2026/05/26 17:22:09