Hi @nadine,
From what I can read, ARRAY_CONTAINS only works for finding a single element in an array, which isn’t the above use case. I need to know if any values in an array are contained in an array.
Does something like this work? If not, please elaborate more on what you are looking for. In this example, it returns the right records on what you’re expecting. [TLDR: I did a typo on the name, but the records are correct).
with tags_id as (
SELECT ARRAY_INTERSECT(tags, ['tag-a', 'tag-c']) as tags_wanted, id, name
FROM commons.CommunityQuestion c
)
select tags_wanted, id, name
from tags_id
where length(tags_wanted) != 0