PostgreSQL check if array contains any element from left-hand array

Sure, use the && array-overlaps operator:

SELECT ARRAY[1,2] && ARRAY[1,3,4,7];

See array functions and operators.

Leave a Comment