sql中all,any,some用法
来源:动视网
责编:小采
时间:2020-11-09 07:13:45
sql中all,any,some用法
sql中all,any,some用法:--All:对所有数据都满足条件,整个条件才成立,例如:5大于所有返回的id select * from #A where 5>All(select id from #A) go --Any:只要有一条数据满足条件,整个条件成立,例如:3大于1,2 select * from #A where 3&g
导读sql中all,any,some用法:--All:对所有数据都满足条件,整个条件才成立,例如:5大于所有返回的id select * from #A where 5>All(select id from #A) go --Any:只要有一条数据满足条件,整个条件成立,例如:3大于1,2 select * from #A where 3&g

--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)
sql中all,any,some用法
sql中all,any,some用法:--All:对所有数据都满足条件,整个条件才成立,例如:5大于所有返回的id select * from #A where 5>All(select id from #A) go --Any:只要有一条数据满足条件,整个条件成立,例如:3大于1,2 select * from #A where 3&g