原文地址:http://hi.baidu.com/tz3638/blog/item/6ddde0dc373b67a5cc116645.html

create table #A(id int)
go
insert into #A s(1)
insert into #A s(2)
insert into #A s(3)
insert into #A s(4)
go

--All:对所有数据都满足条件,整个条件才成立,例如:5大于所有返回的id
select *
from #A
where 5>All(select id from #A)
go

--Any:只要有一条数据满足条件,整个条件成立,例如:3大于1,2
select *
from #A
where 3>any(select id from #A)
go
--Some和Any一样

posted on 2009-12-17 22:37  Myhsg  阅读(3760)  评论(0编辑  收藏  举报