当前位置:网站首页>SQL JOIN 入门使用示例学习左连接、内连接、自连接
SQL JOIN 入门使用示例学习左连接、内连接、自连接
2022-07-24 12:33:00 【知识大胖】
为什么我们需要学习 SQL JOIN
也许您甚至没有意识到,我们也经常遇到加入 Excel 的情况。这是通过 VLOOKUP 函数实现的,如下所示。VLOOKUP 函数允许我们执行一列的匹配并从另一列返回相应的参考值。在这种情况下,我们可以通过将 country_code 与Country Code表中的fips_code匹配来找到与每个条件相关的country_name 。

当一张表的信息不够用时,我们可能会遇到很多这样的情况。SQL 连接使用完全相同的逻辑,但它更强大,因为它匹配和合并两个或多个表而不是两列。在下一节中,我们将深入探讨如何使用 SQL 来解决这个问题。学习 SQL 连接的另一个非常实际和现实的原因是 INTERVIEW!没错,SQL join 几乎是任何数据科学家或数据分析师面试中不可避免的问题。有些问题比较理论和明确,“你能告诉我 LEFT JOIN 和 INNER JOIN 的区别吗?”;其他人则更实际和含蓄 “你能写一条 SQL 语句来找到这个员工的经理的名字吗?” 所以它给了你另一个理由来学习和区分每种连接的实现。
如何创建联接
SELECT <attributeName>, <attributeName>, <attributeName>, ...
FROM <TableA>
<LEFT|INNER|FULL OUTER|...> JOIN <TableB>
ON <TableA.commonAttribute> = <TableB.commonAttribute>
边栏推荐
- Behind the rapid growth, Huawei cloud Wulanchabu data center is the green way
- try...finally总结
- 有没有2、3w前期适合一个人干的创业项目呢?做自媒体可以吗?
- 微信公众号开发:素材管理(临时、永久)
- Calculate the distance between the longitude and latitude of two coordinates (5 ways)
- Reserved instances & Savings Plans
- Ah, I am uncle card space
- Use abp Zero builds a third-party login module (4): wechat applet development
- Is there any entrepreneurship project suitable for one person in the early stage of 2W and 3W? Is it OK to be we media?
- Shell script case ---2
猜你喜欢

Reserved instances & Savings Plans

如何将Typora中图片上传到csdn

从零实现深度学习框架——再探多层双向RNN的实现
向勒索病毒说不,是时候重塑数据保护策略

Wechat applet generates QR code
![[mathematical basis of Cyberspace Security Chapter 3] congruence](/img/00/42a5f7f6f0e8a50884f4639767949f.jpg)
[mathematical basis of Cyberspace Security Chapter 3] congruence

微信小程序-绘制仪表盘

微信公众号开发:素材管理(临时、永久)

With the strong development of cloud native, how should enterprises seize business opportunities

TypeNameExtractor could not be found
随机推荐
Day5: construct program logic
Day4: circular structure
One of his birds sold for 60million -- the collection of eight mountain people in the Ming and Qing Dynasties
Okaleido tiger NFT即将登录Binance NFT平台
QWaitCondition 的正确使用方法
Online XML to CSV tool
[Commons beanautils topic] 004 beanautils topic
Shell script case ---2
Use abp Zero builds a third-party login module (4): wechat applet development
QT notes - qtablewidget table spanning tree, qtreewidget tree node generates table content
How to find out the function calling process of complex code running as soon as possible
STM32 - Fundamentals of C language
Design of digital oscilloscope based on arm and FPGA -- QMJ
Summary of MySQL database combined with actual SQL optimization of the project
[C and pointer Chapter 14] preprocessor
PM's alarm: "NPM warn config global --global, --local are deprecated
Industry insight | how to better build a data center? It and business should "go together"
MES系统设备管理概述(中)
How to eliminate the character set and sorting rules specially set for fields in MySQL tables?
Please ask whether Oracle CDC does not support checkpointing. When the task is suspended and restarted during the real-time collection process, is the data changed