Hi here is the example:
DROP Table #a
DROp Table #b
Create table #a
(
Col1 int
,COL2 varchar(10)
)
Create table #b
(
col1 int
,COL2 varchar(10)
)
insert into #a
Values (1,'Y')
insert into #a
Values (2,'N')
insert into #a
Values (3,'Y')
insert into #a
Values (4,'N')
insert into #b
Values (1,'Y')
insert into #b
Values (2,'N')
Select * from #a a where a.COL2 not in ( select Col2 from #b B where b.COL2='Y')
Hope this helps!!! because I wanted to use join , not except .