Dalitos
Dalitos

Reputation: 109

Postgres WHERE any(arrayPostgres) = any(arrayParameter)

how is the following condition working? i have an postgres array and call a function with an array as paramter. As condition i want to check the following:

WHERE any(array[x,y]) = any(array[y,z])

Thus is minimum one element of the postgres array in the parameter array?

Upvotes: 1

Views: 41

Answers (1)

Nick Barnes
Nick Barnes

Reputation: 21356

You can do this with the overlap operator:

WHERE array[x,y] && array[y,z]

Upvotes: 1

Related Questions