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,
SELECT n FROM Nums
WHERE n IN (1, 2)
Or n Is null
This will retrieve what you intend to get. As said by Mitch normally a comparison to Null yields UNKNOWN
. This is because NULL itself is defined as an undefined value. It's like saying I lived in Nottingham, Birmingham and somewhere. Finding somewhere on the world map can prove a bit tricky as it is undefined.