IN vs ANY operator in PostgreSQL
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 with an example? 2 Answers 2
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 with an example? 2 Answers 2
I have a simple SQL query in PostgreSQL 8.3 that grabs a bunch of comments. I provide a sorted list of values to the IN construct in the WHERE clause: SELECT * FROM comments WHERE (comments.id IN (1,3,2,4)); This returns comments in an arbitrary order which in my happens to be ids like 1,2,3,4. I … Read more
What is the difference between the EXISTS and IN clause in SQL? When should we use EXISTS, and when should we use IN? 2Best Answer 21 The exists keyword can be used in that way, but really it’s intended as a way to avoid counting: –this statement needs to check the entire table select count(*) … Read more