Here are 2 tables:
declare @Table1 table (ID int NOT NULL PRIMARY KEY, Value int)
declare @Table2 table (ID int NOT NULL PRIMARY KEY, Value int)
insert into @Table1 (ID, Value)
select 1, 100
union all
select 2, 101
union all
select 3, 103
union all
select 4, 104
union all
select 5, 105
insert into @Table2 (ID, Value)
select 1, 100
union all
select 2, 110
union all
select 3, 111
I need to select all rows from first table, which Value's values are not in Table2. How to do it?