Skip to main content
Version: 24.3.x

Categories: Semi-Structured Data

ARRAYS_OVERLAP

Compares whether two arrays have at least one element in common. Returns true if the arrays have one or more elements in common; otherwise returns false.

Syntax

ARRAYS_OVERLAP(arr1 LIST, arr2 LIST) → BOOLEAN

  • arr1: The first array.
  • arr2: The second array.

Examples

ARRAYS_OVERLAP example
SELECT ARRAYS_OVERLAP(ARRAY['foo', 'bar'], ARRAY['bar', 'baz'])
-- true
ARRAYS_OVERLAP example
SELECT ARRAYS_OVERLAP(ARRAY['foo', 'bar'], ARRAY['baz', 'qux'])
-- false