celko

SQL Server: Why does comparison null=value return true for NOT IN?

Why does the comparison of value to null return false, except when using a NOT IN, where it returns true? Given a query to find all stackoverflow users who have a post: SELECT * FROM Users WHERE UserID IN (SELECT UserID FROM Posts) This works as expected; i get a list of all users who have a post. Now query for the inverse; find a...