Is there an array intersect function in Redshift, or a good way it can be done?
For example in Snowflake it is:
SELECT array_intersection(ARRAY_CONSTRUCT('A', 'B'), ARRAY_CONSTRUCT('B', 'C'));
Output: ["B"]
The documentation doesn't seem to have this function or anything I can find remotely useful.
I am avoiding unnesting the arrays to join if I don't have to.
Any ideas?
I don't think it has any built-ins like that as far as I'm aware. You mentioned not wanting to unnest, but I think that is going to be your best (and only) option on Redshift: