您现在的位置是: 首页 > 后端开发 SqlServer 优化技巧
SqlServer 优化技巧
2020-05-20 【后端开发】 1534人已围观 2763次浏览
简介SqlServer 优化技巧
查询在A表但是不在B表中的数据
– 效率低,但是容易理解
select distinct A.ID from A where A.ID not in (select ID from B)
– 图解
select A.ID from A left join B on A.ID=B.ID where B.ID is null
– 逻辑相对复杂,但是效率最高
select * from B where (select count(1) as num from A where A.ID = B.ID) = 0
很赞哦! (0)
下一篇:常见端口号
相关文章
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot 启动测试时出现提示 Test class should have exactly one public zero-argument constructor
- Laravel项目出现could not be opened: failed to open stream: Permission denied
- SqlServer 刷新所有视图
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
- SpringBoot @NotBlank 不生效问题
- mac idea spring boot 启动慢
- PHP 中list()出现Undefined offset: 0错误
- 记一次Java MessageFormat.format踩坑
- SqlServer字符串处理
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- nuxt 项目完整部署方案
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
站长推荐
猜你喜欢
- SpringBoot 2.x Security security.basic.enabled=false 失效问题解决
- Zookeeper 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
- Vue 路由跳转后不在顶部
- 在使用Flutter进行网络请求时,使用Dio访问https地址出现unable to get local issuer certificate错误
- Linux 修改默认的 ssh 22 端口
- 在更新python时出现dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib,Reason: image not found错误解决方案
- CentOS 安装JDK
- ThinkPHP 解决跨域访问问题
- Linux 服务器之间传输大文件(压缩文件、查看MD5、后台传输)
- mybatis中大于等于小于等于的写法