SQL中All, Any, Some的意思

create table #A(id int)
go
insert into #A values(1)
insert into #A values(2)
insert into #A values(3)
insert into #A values(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一样 

备注:Any的用法中,在作数字比对时,也可以改用先select subquery的min/max value的方法,某些情况下效率更高

 
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SQL Server 2016 Developer's Guide by Dejan Sarka English | 22 Mar. 2017 | ASIN: B01MS5L01Q | 616 Pages | AZW3 | 16.98 MB Get the most out of the rich development capabilities of SQL Server 2016 to build efficient database applications for your organization About This Book Utilize the new enhancements in Transact-SQL and security features in SQL Server 2016 to build efficient database applications Work with temporal tables to get information about data stored in the table at any point in time A detailed guide to SQL Server 2016, introducing you to multiple new features and enhancements to improve your overall development experience Who This Book Is For This book is for database developers and solution architects who plan to use the new SQL Server 2016 features for developing efficient database applications. It is also ideal for experienced SQL Server developers who want to switch to SQL Server 2016 for its rich development capabilities. Some understanding of the basic database concepts and Transact-SQL language is assumed. What You Will Learn Explore the new development features introduced in SQL Server 2016 Identify opportunities for In-Memory OLTP technology, significantly enhanced in SQL Server 2016 Use columnstore indexes to get significant storage and performance improvements Extend database design solutions using temporal tables Exchange JSON data between applications and SQL Server in a more efficient way Migrate historical data transparently and securely to Microsoft Azure by using Stretch Database Use the new security features to encrypt or to have more granular control over access to rows in a table Simplify performance troubleshooting with Query Store Discover the potential of R's integration with SQL Server In Detail Microsoft SQL Server 2016 is considered the biggest leap in the data platform history of the Microsoft, in the ongoing era of Big Data and data science. Compared to its predecessors, SQL Server 2016 offers developers a unique opportuni

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值