当前位置:网站首页>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的用法:添加约束,两个表连接的条件
两表连接需要给每个表取表名
边栏推荐
猜你喜欢
随机推荐
MySQL存储过程函数
iptables
Problems and solutions of paddleocr packaging
MySQL stored procedure function
继承的详细介绍与理解,看了就懂
动态规划(背包问题)
Web services (02) - Web server middleware
Use ECs and OSS to set up personal network disk
[cann training camp] enter media data processing (Part 2)
虚拟化技术KVM
Shell script - automatically deploy DNS services
GDB的使用
How should CDC be configured for Oracle cluster mode? I can run normally in stand-alone mode, but I can't read the increment in cluster mode
Suggestions for beginners of MySQL (strongly recommended ~ don't regret ~ ~)
【无标题】
IO function of standard C library
Summary and review of key points of digital image processing
D - Difference HDU - 5936
Review of wireless sensor networks (Bilingual)
29shell function





![[untitled]](/img/2a/53327cd39db7871fa780ed599420d0.png)



