Comparison operators compare two values. They are binary operators that return values of type boolean.
Operators
Operator
Description
<
less than
>
greater than
<=
less than or equal to
>=
greater than or equal to
=
equal
<> or !=
not equal
Considerations
Ordinary comparison operators yield NULL (signifying “unknown”) if either input is NULL. For example, 7 = NULL returns NULL. If this behavior doesn’t fit your use case, use the IS NOT DISTINCT FROM predicate to treat NULL as an ordinary value.