I am stuck with a query that does not return any value despite it should. I have
Table1 with around 50000 different IDs, and Table2 with around 1000 different IDs. I run this query:
Select * From Table1 T1
Where T1.ID not in ( Select Id From Table2 T2 Where 1 = 1 )
I did expect this query to give me at least 49000 rows but I do not get a single one. Now, when I run
Select * From Table1 T1
Where T1.ID not in ( Select Id From Table2 T2 Where T2.Id = T1.Id )
I do get my expected result (which is 49000 rows). However I does not feel very logic to me. From a set theoretical point of view the second where clause does not make sense and the first query just should work anyways...