| 发表于:2007-09-22 15:32:211楼 得分:0 |
declare @t1 table(id int,names varchar(10)) insert @t1 select 1,'n1' union all select 2,'n2' union all select 3,'n3' union all select 4,'n4' declare @t2 table(id int,names varchar(10),customer varchar(50)) insert @t2 select 1,'n1','amc' union all select 2,'n2','ampag' union all select 3,'n4','fortune' select * from @t1 a where not exists(select 1 from @t2 where a.names=names) | | |
|