当前位置:网站首页>left join 、inner join 、right join区别
left join 、inner join 、right join区别
2022-07-26 22:46:00 【Meme_xp】
左联结:

取出左边表的全部,如果右边有对应的(左右索引重合的部分),没有的都自动添加null!!!!!
得到左边的所有信息和重合信息

连接结果深化

只需要:
什么是连接

交叉联接相当于笛卡尔积!!!!!!!!
什么是内连接,inner join



inner join:2表值都存在
outer join:附表中值可能存在null的情况。
总结:
①A inner join B:取交集
②A left join B:取A全部,B没有对应的值,则为null
③A right join B:取B全部,A没有对应的值,则为null
④A full outer join B:取并集,彼此没有对应的值为null
上述4种的对应条件,在on后填写。
on的用法:添加约束,两个表连接的条件
两表连接需要给每个表取表名
边栏推荐
猜你喜欢

You can understand the detailed introduction and understanding of inheritance

Shell programming specifications and variables

27shell之条件语句

Review of wireless sensor networks (Bilingual)

24ssh service

mysql的安装

22FTP

Guidance process and service control

Atcoder D - increment of coins (probability DP)

Shell (9) function
随机推荐
Process and planned task management
Use of GDB
23NFS共享存储服务
The bottom implementation of string container
RT-thread学习
31 regular expression
Web services (02) - Web server middleware
21DNS域名解析
Shell (8) cycle
Shell loop statement
Complete super detailed introduction to transactions in MySQL
MySQL备份恢复
mysql的安装
Which securities company is better or safer for retail investors to open accounts
Create a daemon
C language foundation Gobang, very easy to understand, detailed explanation, easy to use
Review of information acquisition technology
Expect interaction free
Regular expression gadget series
Shell (12) regular expression