Hi,I have two tables, #TableA(in memory temp table) and TableB(db table) both having same columns.#TableA does not have primary key restriction on it.Now, I have following select statementSELECT new.* FROM #TableA AS newLEFT JOIN TableB AS oldON new.[ColId] = old.[ColId]WHERE old.[ColId] IS NULL
TableA has 298 rowsTableB has 298 rowsBut when I run above query I get 4 specific rows.Now when I remove that Where clause and just run following selectSELECT new.* FROM #TableA AS newLEFT JOIN TableB AS oldON new.[ColId] = old.[ColId]
I get 298 rows again.Can anyone explain or throw some light on what is happening in this select statement with Where clause?[TableB].[ColId] is a primary key in the table and has no row with NULL in ColId column.