当前位置:网站首页>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…
边栏推荐
- The role of software security testing, how to find a software security testing company to issue a report?
- Qt中使用QDomDocument操作XML文件
- Intranet learning notes (7)
- Redis
- 李宏毅《机器学习》丨6. Convolutional Neural Network(卷积神经网络)
- How to monitor the log through the easycvr interface to observe the platform streaming?
- Application of TSDB in civil aircraft industry
- Four characteristics of actual attack and defense drill
- Charles packet capturing tool
- Yarn: unable to load file c:\users\xxx\appdata\roaming\npm\yarn PS1 because running scripts is prohibited on this system
猜你喜欢
Intranet learning notes (5)
Unity存档系统——Json格式的文件
UnityShader入门精要——表面着色器
What is the reason for the disconnection of video playback due to the EHOME protocol access of easycvr platform?
AI服装生成,帮你完成服装设计的最后一步
Talking about the advantages of flying book in development work | community essay solicitation
Use of hashcat
Experience of epidemic prevention and control, home office and online teaching | community essay solicitation
进入阿里做测试员遥不可及?这里或许有你想要的答案
Of the seven levels of software testers, it is said that only 1% can achieve level 7
随机推荐
Charles 抓包工具
NPM package publishing tutorial
保险APP适老化服务评测分析2022第06期
目录权限错误导致 Oracle 11g rac 集群数据库无法启动的问题
|遇到bug怎么分析,专业总结分析来了
AI服装生成,帮你完成服装设计的最后一步
Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
[live review] battle code pioneer phase 7: how third-party application developers contribute to open source
F - Spices(线性基)
计算机三级(数据库)备考题目知识点总结
计网 | 【四 网络层】知识点及例题
Uncaught Error: [About] is not a <Route> component. All component children of <Routes> must be a <Ro
Charles packet capturing tool
After reciting the eight part essay, I won the hemp in June
进入阿里做测试员遥不可及?这里或许有你想要的答案
Pit entry machine learning: I. Introduction
Transformers Roberta如何添加tokens
Modifying universal render data at runtime
It's 2022, and you still don't know what performance testing is?
Investigation on key threats of cloud computing applications in 2022