I don\'t like not knowing this as there may be situations when I need to use one instead of the other. It seems in most cases they produce the same results but I am taking a
<>
is the standard SQL operator meaning "not equal". Many databases, including postgresql, supports !=
as a synonym for <>
.
They're exactly the same in postgresql. See also the documentation.
Note though, that postgresql allows you to implement your own types and
overload operators for those types, so ultimately it depends on the datatypes involved what the !=
and <>
operator actually does, but <>
and !=
can never do different things.