Když to uděláte
select 2 != any(array[2,3,4]);
?column?
----------
t
2 bude porovnáno se všemi položkami pole a pokud nějaké existuje, ke kterému 2 není rovno, vyhodnotí se jako true .
Použijte not id = any(array[2,3,4])
select not 1 = any(array[2,3,4]);
?column?
----------
t
select not 2 = any(array[2,3,4]);
?column?
----------
f
Nebo != all
select 1 != all(array[2,3,4]);
?column?
----------
t
select 2 != all(array[2,3,4]);
?column?
----------
f