As the title says, i'm trying to filter a list of given IDs (could be hundreds) into a list of IDs that do not exist in a table (could have multiple thousands of rows). My research suggests that I should be doing something like this:
select *from ( values (1),(2),(3)) as temp(id)where not exists (select * from mytable where mytable.id = temp.id);
select *from ( values (1),(2),(3)) as temp(id)where not exists (select * from mytable where mytable.id = temp.id);
Would you agree and more importantly, can I do this using ORM syntax?