Select Distinct FileId From dbo.Files
returns 3415 rows
Select Distinct FileId From dbo.SyncHistory Where Date > '2015/7/1'
returns 2483 rows.
Select Distinct FileId From dbo.Files
Where FileId In (Select Distinct FileId From dbo.SyncHistory Where Date > '2015/7/1')
returns 2482 rows. Okay so someone synced this month but then deleted their file I assume.
BUT:
Select Distinct FileId From dbo.Files
Where FileId NOT In (Select Distinct FileId From dbo.SyncHistory Where Date > '2015/7/1')
Returns 0 rows.
I thought my connection was broken but I've run and rerun it and the results are consistent if also consistently wrong. Is this a sql bug? What am I missing here?