Comparison operators and predicates compare values and return a boolean result. Use them to:
Compare two values with the standard relational operators.
Test ranges with BETWEEN.
Handle NULL and boolean states with NULL-aware and truth-value predicates.
Compare against a set of values with IN, ANY/SOME, and ALL.
Considerations
Ordinary comparison operators yield NULL (signifying “unknown”) if either input is NULL. To compare NULL as an ordinary value, use the IS [NOT] DISTINCT FROM predicates.
IN/NOT IN and the array quantifiers compare a value against multiple values without a subquery. For the subquery forms of these constructs, see Subquery Comparisons.