--<>all等价于 not in
--<>some不等价于not in declare @a table (id int)
insert into @a select 1
insert into @a select 2
insert into @a select 3
insert into @a select 4declare @b table (id int)
insert into @b select 4
insert into @b select 5
insert into @b select 6
insert into @b select 7select * from @a
where id<>all(select id from @b)select * from @a
where id<>some(select id from @b where id=4)select * from @a
where id<>some(select id from @b)1
2
31
2
31
2
3
4楼主可以查查帮助