比如:A,B两表,找到ID字段中,存在A表,但不存在B表的数据。

A表共13w,去重后3w,

B表共2W,且有索引

方法一

not in,易理解,效率低,时间:1.395s

方法二

left...join...on ,B.id isnull    时间:0.739s

方法三

效率高,时间:0.57s

select * from  A where (select count(1) as num from B where A.ID = B.ID) = 0


最新文章

  1. 使用IntelliJ IDEA和Maven构建Java web项目并打包部署
  2. 通信服务器群集——跨服务器通信Demo(源码)
  3. 高校手机签到系统——第一部分Authority权限系统(下)
  4. Linux prerouting和postrouting的区别
  5. recordcount
  6. 【MySQL】DNS与MHA/ZABBIX构建的高可用MySQL
  7. UML类图常见关系总结
  8. JavaScript--正则表达式(笔记)
  9. asp.net中几个网页跳转的方法及区别
  10. 【转】#include_next <filename.h>
  11. jedis访问redis学习笔记
  12. 配置一个servlet程序
  13. delphi显示hello world 和退出程序
  14. (三十八)从私人通讯录引出的细节II -数据逆传 -tableView点击 -自定义分割线
  15. powershell 函数, foreach中格式化
  16. web.xml:<url-pattern>
  17. MPLS笔记
  18. python 打印 emoji
  19. shiny: Web Application Framework for R
  20. 启动Activiti项目报错:org.activiti.engine.ActivitiObjectNotFoundException: no deployed process definition found with id '22501'

热门文章

  1. Node.js实战6:定时器,使用timer延迟执行。
  2. Pikachu漏洞练习平台实验——SQL注入(四)
  3. 屏幕坐标点转UGUI坐标【包含屏幕适配】
  4. PyInstaller库的使用
  5. DTS
  6. 灰常牛逼的命令行备忘录 navi
  7. Codeforces Round #392 (Div. 2) - B
  8. SVN中trunk,branches,tags的使用明细--项目代码的管理
  9. ansible笔记(二)--配置文件详解
  10. Wait and Click Element