当前位置:网站首页>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>
边栏推荐
- Do you regret learning it?
- QT notes - qtablewidget table spanning tree, qtreewidget tree node generates table content
- Use abp Zero builds a third-party login module (4): wechat applet development
- QT notes - sort a column specified by qtablewidget
- Guys, do you need to configure anything to use rocksdb when using flinksql? Or do you need any jar packages
- Summary of MySQL database combined with actual SQL optimization of the project
- Time processing of basic library in go
- Force deduction exercise - 29 complete the array as required
- leecode-268. 丢失的数字(异或的应用,找没有出现的数字,找只出现一次的数字)
- Opencv:08 image pyramid
猜你喜欢

TypeNameExtractor could not be found

Zabbix5.0.8-odbc monitoring Oracle11g

QT notes - qtxml

One of his birds sold for 60million -- the collection of eight mountain people in the Ming and Qing Dynasties

Native Crash的一切

Microsoft SQL Server database language and function usage (XII)
How to render millions of 2D objects smoothly with webgpu?

字符串匹配的KMP

基于Qt的软件框架设计

Installation and deployment of ansible
随机推荐
雪花算法(PHP)
Behind the rapid growth, Huawei cloud Wulanchabu data center is the green way
One of his birds sold for 60million -- the collection of eight mountain people in the Ming and Qing Dynasties
How to upload pictures from typora to CSDN
Buckle practice - sum of 34 combinations
QT notes - custom data types
[leetcode]- linked list-3
02 linear structure 2 multiplication and addition of univariate polynomials (linked list solution)
Implementing deep learning framework from zero -- further exploration of the implementation of multilayer bidirectional RNN
Buckle practice - maximum number of 28 splices
How to eliminate the character set and sorting rules specially set for fields in MySQL tables?
Okaleido tiger NFT即将登录Binance NFT平台
Industry insight | how to better build a data center? It and business should "go together"
微信小程序-绘制仪表盘
Everything about native crash
Day4: circular structure
Summary of MySQL database combined with actual SQL optimization of the project
JS image to Base64
Say no to blackmail virus, it's time to reshape data protection strategy
有没有2、3w前期适合一个人干的创业项目呢?做自媒体可以吗?