当前位置:网站首页>left join on和 join on的区别
left join on和 join on的区别
2022-06-24 23:26:00 【春风霓裳】
参考:https://blog.csdn.net/lovebosom/article/details/51035894
Join 等同于 inner join : 表示两个表都必须存在的
left join 表示以左边的表为基准,不管你右边的表有没有都显示
right join和left join刚好相反
full outer join表示只要在两个表中任何一个表中有的都显示
相同点:都能通过关联表,使用where查询出想要的数据
1、当两个表中,关联的数据值有一个表中没有值时,这时 left join是当左边的表有值时,也能查询出值,且右边表的数据此时全部以null表示!
eg:
left join…on…
可以看到left join…on…,当右边的表相关联的数据不存在时这种情况,是不会将关联的这条数据当做没有用的数据;
join…on…

可以看到join…on…,当右边的表相关联的数据不存在时这种情况,会将关联的这条数据当做没有用的数据,就不会查询出这种数据;
2、在关联的时候使用条件时,left join…on…会将不满足条件的主表信息都查出来,但附表(关联表)所有字段会用null表示,所以有时,要查不满足条件的主表时,就可以加上where 附表id=null查询出来!而join…on…会将不满足的数据直接忽略,都不会被查出来
eg:
left join…on…
join…on…

边栏推荐
- Talking about the advantages of flying book in development work | community essay solicitation
- ida中交叉引用的解析
- 会自动化—10K,能做自动化—20K,你搞懂自动化测试没有?
- Distributed transaction solutions and code implementation
- Test / development programmers, 30, do you feel confused? And where to go
- E - average and median
- UnityShader入门精要——表面着色器
- 同花顺是正规平台吗?同花顺开户安全吗
- Network planning | [four network layers] knowledge points and examples
- Computing service network: a systematic revolution of multi integration
猜你喜欢

yarn : 无法加载文件 C:\Users\xxx\AppData\Roaming\npm\yarn.ps1,因为在此系统上禁止运行脚本

【直播回顾】战码先锋第七期:三方应用开发者如何为开源做贡献

Application of TSDB in civil aircraft industry

It is said that Yijia will soon update the product line of TWS earplugs, smart watches and bracelets

Distributed transaction solutions and code implementation

Intranet learning notes (7)

AI服装生成,帮你完成服装设计的最后一步

How to monitor the log through the easycvr interface to observe the platform streaming?

Getting started with unityshader - Surface Shader

都2022年了,你还不了解什么是性能测试?
随机推荐
当他们在私域里,掌握了分寸感
The Oracle 11g RAC cluster database cannot be started due to directory permission errors
Exploring the mystery of C language program -- C language program compilation and preprocessing
Investigation on key threats of cloud computing applications in 2022
PyTorch学习笔记(七)------------------ Vision Transformer
UnityShader入门精要——表面着色器
Kaggle 专利匹配比赛金牌方案赛后总结
把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(4)—— 修改 oracle11g rac 集群的 scanIP
数据库系统概论必背知识
Can automate - 10k, can automate - 20K, do you understand automated testing?
Intranet learning notes (5)
Detailed explanation of cache (for the postgraduate entrance examination of XD)
F - Spices(线性基)
Once beego failed to find bee after passing the go get command Exe's pit
记一次beego通过go get命令后找不到bee.exe的坑
ERROR日志格式与注意点
转行软件测试2年了,给还在犹豫的女生一点建议
【FPGA】串口以命令控制温度采集
Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
AI服装生成,帮你完成服装设计的最后一步