What is the difference between IN and ANY operator in PostgreSQL?
The working mechanism of both seems to be the same. Can anyone explain this w
There are two obvious points, as well as the points in the other answer:
They are exactly equivalent when using sub queries:
SELECT * FROM table
WHERE column IN(subquery);
SELECT * FROM table
WHERE column = ANY(subquery);
On the other hand:
Only the IN operator allows a simple list:
SELECT * FROM table
WHERE column IN(… , … , …);
Presuming they are exactly the same has caught me out several times when forgetting that ANY doesn’t work with lists.