当前位置:网站首页>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文件基础结构梳理
- 记一次beego通过go get命令后找不到bee.exe的坑
- How transformers Roberta adds tokens
- 3年测试经验,连简历上真正需要什么都没搞明白,张口就要20k?
- 文件系统 -- 磁盘基础知识和FAT32文件系统详细介绍
- The Oracle 11g RAC cluster database cannot be started due to directory permission errors
- 一线城市软件测试工资——你拖后腿了吗
- Unity存档系统——Json格式的文件
- LINQ 查询(3)
- [live review] battle code pioneer phase 7: how third-party application developers contribute to open source
猜你喜欢

使用ShaderGraph制作边缘融合粒子Shader的启示

Unity存档系统——Json格式的文件
![Planification du réseau | [quatre couches de réseau] points de connaissance et exemples](/img/c3/d7f382409e99eeee4dcf4f50f1a259.png)
Planification du réseau | [quatre couches de réseau] points de connaissance et exemples

Pit entry machine learning: I. Introduction

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

PyTorch学习笔记(七)------------------ Vision Transformer

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

qt打包exe文件,解决“无法定位程序输入点_ZdaPvj于动态链接库Qt5Cored.dll”

Can automate - 10k, can automate - 20K, do you understand automated testing?

When they are in private, they have a sense of propriety
随机推荐
华为、阿里等大厂程序员真的好找对象吗?
Lizuofan, co-founder of nonconvex: Taking quantification as his lifelong career
Software testing salary in first tier cities - are you dragging your feet
MySQL command backup
After reciting the eight part essay, I won the hemp in June
对进程内存的实践和思考
产业互联网的概念里有「互联网」字眼,但却是一个和互联网并不关联的存在
Leetcode 210: curriculum II (topological sorting)
File system - basic knowledge of disk and detailed introduction to FAT32 file system
ProcessOn制作ER过程(自定义)
Planification du réseau | [quatre couches de réseau] points de connaissance et exemples
把 Oracle 数据库从 Windows 系统迁移到 Linux Oracle Rac 集群环境(4)—— 修改 oracle11g rac 集群的 scanIP
Is the compass reliable? Is it safe to open a securities account?
The role of software security testing, how to find a software security testing company to issue a report?
Modifying universal render data at runtime
【Proteus仿真】Arduino UNO+数码管显示4x4键盘矩阵按键
文件系统 -- 磁盘基础知识和FAT32文件系统详细介绍
计网 | 【四 网络层】知识点及例题
centos7.3修改mysql默认密码_详解Centos7 修改mysql指定用户的密码
PE文件基础结构梳理