当前位置:网站首页>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…

边栏推荐
- PE file infrastructure sorting
- Pit entry machine learning: I. Introduction
- Charles packet capturing tool
- ARM汇编中的栈桢小结
- Enlightenment of using shadergraph to make edge fusion particle shader
- What is the reason for the disconnection of video playback due to the EHOME protocol access of easycvr platform?
- What are the reasons for the abnormal playback of the online channel of the channel accessed by easycvr national standard protocol?
- leecode学习笔记-机器人走到终点的最短路径
- Exploring the mystery of C language program -- C language program compilation and preprocessing
- Left hand dreams right hand responsibilities GAC Honda not only pays attention to sales but also children's safety
猜你喜欢

Exploring the mystery of C language program -- C language program compilation and preprocessing

Intranet learning notes (5)

Leecode learning notes - the shortest path for a robot to reach its destination

会自动化—10K,能做自动化—20K,你搞懂自动化测试没有?

I've been doing software testing for two years. I'd like to give some advice to girls who are still hesitating

一线城市软件测试工资——你拖后腿了吗

保险APP适老化服务评测分析2022第06期

leecode学习笔记-机器人走到终点的最短路径

进入阿里做测试员遥不可及?这里或许有你想要的答案

【STL源码剖析】STL六大组件功能与运用(目录)
随机推荐
E - Average and Median(二分)
常用的软件测试工具清单,请查收。
Are programmers from Huawei, Alibaba and other large manufacturers really easy to find?
Four characteristics of actual attack and defense drill
What is the reason for the disconnection of video playback due to the EHOME protocol access of easycvr platform?
产业互联网的概念里有「互联网」字眼,但却是一个和互联网并不关联的存在
Talking about the advantages of flying book in development work | community essay solicitation
[I.MX6UL] U-Boot移植(六) 网络驱动修改 LAN8720A
记一次beego通过go get命令后找不到bee.exe的坑
数据库系统概论必背知识
Post competition summary of kaggle patent matching competition
Yarn: unable to load file c:\users\xxx\appdata\roaming\npm\yarn PS1 because running scripts is prohibited on this system
ida中交叉引用的解析
【STL源码剖析】配置器(待补充)
npm包发布详细教程
【直播回顾】战码先锋第七期:三方应用开发者如何为开源做贡献
算力服务网络:一场多元融合的系统革命
I've been doing software testing for two years. I'd like to give some advice to girls who are still hesitating
Jetson nano from introduction to practice (cases: opencv configuration, face detection, QR code detection)
Network planning | [four network layers] knowledge points and examples