I have a table called NUMS with a single column n.
And I fill values 1,2,3,4,5,null in it.
Now a query
SELECT n FROM Nums
WHERE n IN (1, 2,
I am also comparing n with a null value which should yield unknown and it should return an empty set.
it shouldn't if you need in additional row filled with NULL values the best way imo is:
SELECT n FROM Nums WHERE n IN(1,2)
UNION
SELECT NULL
Now a query
SELECT n FROM Nums WHERE n NOT IN(1, 2, null)
...gets converted to:
Here what I said above works and it does not return anything.
thats right, because nothing can be equal to NULL and for NULL comparison IS NULL statement is used