当前位置:网站首页>sql 左连接,内连接 的写法「建议收藏」
sql 左连接,内连接 的写法「建议收藏」
2022-07-28 21:58:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
左连接的含义: 使用 LEFT JOIN 关键字,会从 左表 那里返回所有的行,即使在 右表 中没有匹配的行。
1)左连接
select a.*, b.*
from table1 a
left join table2 b
on a.id = b.parent_id
2) 内连接
select a.*, b.*
from table1 a
inner join table2 b
on a.id = b.parent_id
或
select a.*, b.*
from table1 a
join table2 b
on a.id = b.parent_id
内连接写成 inner join 或 join,没区别发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128979.html原文链接:https://javaforall.cn
边栏推荐
- 你知道有哪些正规的兼职平台吗?
- 浪潮ClusterEngineV4.0 远程命令执行漏洞 CVE-2020-21224
- 深度剖析集成学习Xgboost(续)
- Blocking queue
- The classic dual stack implementation queue, pay attention to the modification of the judgment conditions of traversing the stack.
- Wechat applet development ④
- General paging - background
- Fundamental inquiry binary tree
- Samba service setup
- 22牛客多校day1 I - Chiitoitsu 概论dp
猜你喜欢
随机推荐
金仓数据库 KingbaseES与Oracle的兼容性说明(2. 数据类型)
Combination of smart TV and applet
2022年R2移动式压力容器充装考题模拟考试平台操作
How powerful can top "hackers" be? Internet access without signal, expert: high-end operation!
2022 simulated examination platform operation of hoisting machinery command examination questions
互动滑轨屏在展厅中应用的制作步骤
npm更换最新淘宝镜像
General paging - background
[self] - question brushing - peak value
经典的拓扑排序问题——LeetCode207 课程表+LeetCode210 课程表II
MySQL transaction and storage system
Crud of MySQL
(22杭电多校二)Two Permutation (dp),Package Delivery (贪心)
MySQL functions
Exchange 2013 SSL证书安装文档
顶级“黑客”能厉害到什么地步?无信号也能上网,专家:高端操作!
剑指 Offer 55 - I. 二叉树的深度
Few people can really play in the "aftermarket" of the whole house intelligent fire collection
脲酶丨Worthington杰克豆脲酶的特性及测定方案
PMP考试倒计时,速看3A通关锦囊!

![[self] - question brushing - peak value](/img/cf/9c47da9c574b61415578e7fde8b126.png)







