I have a table T one of whose columns is pixels array<bigint>. How do I check that a number is its element?

When I try

select * from T where 12345 not in pixels;

I get

FAILED: ParseException line 9:24 missing ( at 'pixels' near '<EOF>'

it appears that one can use in only with literal arrays.

what do I do?

有帮助吗?

解决方案

The answer appears to be array_contains:

select * from T where not array_contains(pixels,cast(12345 as bigint));
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top