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

边栏推荐
- MCN机构遍地开花:博主和作者要谨慎签约、行业水很深
- leecode学习笔记-机器人走到终点的最短路径
- centos7.3修改mysql默认密码_详解Centos7 修改mysql指定用户的密码
- Charles 抓包工具
- Transformers Roberta如何添加tokens
- Computing service network: a systematic revolution of multi integration
- What is the reason for the disconnection of video playback due to the EHOME protocol access of easycvr platform?
- Smartctl opens the device and encounters permission denied problem troubleshooting process record
- Intranet learning notes (5)
- Yarn: unable to load file c:\users\xxx\appdata\roaming\npm\yarn PS1 because running scripts is prohibited on this system
猜你喜欢

当他们在私域里,掌握了分寸感

QT package the EXE file to solve the problem that "the program input point \u zdapvj cannot be located in the dynamic link library qt5cored.dll"

背了八股文,六月赢麻了……

记一次beego通过go get命令后找不到bee.exe的坑

Unity archive system - file in JSON format

Transformers Roberta如何添加tokens

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

【STL源码剖析】STL六大组件功能与运用(目录)
![Network planning | [four network layers] knowledge points and examples](/img/c3/d7f382409e99eeee4dcf4f50f1a259.png)
Network planning | [four network layers] knowledge points and examples

Rod and Schwartz cooperated with ZhongGuanCun pan Lianyuan Institute to carry out 6G technology research and early verification
随机推荐
Dirvish Chinese document of vim
消息称一加将很快更新TWS耳塞、智能手表和手环产品线
LINQ query (3)
F - spices (linear basis)
AI服装生成,帮你完成服装设计的最后一步
Groovy之高级用法
npm包发布详细教程
How transformers Roberta adds tokens
Network planning | [four network layers] knowledge points and examples
PE文件基础结构梳理
【FPGA】串口以命令控制温度采集
When they are in private, they have a sense of propriety
Left hand dreams right hand responsibilities GAC Honda not only pays attention to sales but also children's safety
Transformers Roberta如何添加tokens
[STL source code analysis] configurator (to be supplemented)
Centos7.3 modifying MySQL default password_ Explain centos7 modifying the password of the specified user in MySQL
The Oracle 11g RAC cluster database cannot be started due to directory permission errors
Charles 抓包工具
Distributed transaction solutions and code implementation
Summary of knowledge points of computer level III (database) test preparation topics