I am using Postgres v11+ and want to return a dataset if col1 equals value1, value2, or null.
select * from table1 where col1 in (value1, value2, null);
Only thing is that the rows with null are not coming. I have also tried the reverse:
select * from table1 where col1 not in (value3, value4);
However, still the null rows are not coming. I know you can do this with a separate OR statement, i.e.
select * from table1 where col1 in (value1, value2) or col1 isnull;
But this doesn't work for me as I have additional conditions that get (incorrectly) passed when I use OR. (Basically I'd prefer to do this in a single shot).
What's wrong with postgres to where an in statement doesn't work with null?