This question already has an answer here:
I receive results that I consider inconsistent to simple queries.
-- This returns 3 rows select * from persons where person_id in (12,13,14) -- This returns nothing select * from documents where person_id in (12,13,14) -- This returns nothing !?!? select * from persons where persons.person_id not in ( select documents.person_id from documents )
There is a FK on documents.person_id pointing to persons.person_id
Am I missing something? This is my @@version:
Microsoft SQL Server 2016 (SP1-CU1) (KB3208177) - 13.0.4411.0 (X64) Jan 6 2017 14:24:37 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor)