`any` and `all` special Postgres constructs
To determine if a value exists in a subquery or scalar value list you can use
the in
operator like:
> select 1 in (1, 2)
true
any
and all
go a step further by allowing for an operator in the special
construct which is used against each value in the subquery or array (no scalar
value list for these constructs).
any
examples:
> select 1 = any(Array[1, 2, 3])
true
> select 1 > any(Array[1, 2, 3])
false
all
examples
> select 17 <> any(Array[2, 4, 8])
true
> select 17 < any(Array[2, 4, 8])
false
some
is a synonym for any.