declare @table2 table(id int,links varchar(20),name char(1))
insert into @table2
values
(1,'test8','a'),
(1,'test1','b'),
(2,'test9','a'),
(2,'test10','b'),
(3,'test11','b'),
(4,'test13','b')
declare @table1 table(id int,name char(1),link varchar(20))
insert into @table1
values
(1,'a','test1'),
(1,'a','test2'),
(2,'b','test3'),
(2,'b','test4'),
(3,'b','test3')
select * from @table2 where links not in (select link from @table1)
Hope it Helps!!
No comments:
Post a Comment