Home > Database > Mysql Tutorial > sql中all,any,some用法

sql中all,any,some用法

WBOY
Release: 2016-06-07 17:59:15
Original
1994 people have browsed it

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>any(select id from #A)
Related labels:
any
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template