当前位置:网站首页>MySQL (IX)
MySQL (IX)
2022-06-11 10:43:00 【wxxxx_ xx】
SQL92 use + Resolve external connections , But in SQL92 There is no full external connection inside .
SQL99 Use JOIN ON Statement to solve the outer connection .
Oracle Yes SQL92 Better support , Can also be used SQL99, and MySQL Only use SQL99 Make external connections
but MySQL I won't support it SQL99 Use FULL JION Make full external connection .
UNION The operator
UNION Operator returns the union of the result sets of two queries , Remove duplicate records
UNION ALL The operator
UNION ALL Operator returns the union of the result sets of two queries . For duplicate parts of two result sets , No weight removal .

7 Kind of JOIN The implementation of the
Internal connection
Inquire about A Map and B There are data in the figure
SELECT employee_id,department_name FROM employee e JOIN departments d ON e.'employee_id'=d.'department_name';
![]()
The left outer join
Inquire about A There is , however B Tuliwei NULL.
and A Map and B There are records in the picture .
Top left
SELECT employee_id,department_name FROM employee e LEFT JOIN departments d ON e.'employee_id'=d.'department_name';
Right connection
Inquire about B There is , however A Tuliwei NULL.
and A Map and B There are records in the picture .
SELECT employee_id,department_name FROM employee e RIGHT JOIN departments d ON e.'employee_id'=d.'department_name';
![]()
A⊕ B
Only query A There is ,B The data in the figure is NULL The record of
SELECT employee_id,department_name FROM employee e LEFT JOIN departments d ON e.'employee_id'=d.'employee_id' WHERE d.'department_name' IS NULL;
B⊕ A
Only query B There is ,A The data in the figure is NULL The record of
SELECT employee_id,department_name FROM employee e RIGHT JOIN departments d ON e.'employee_id'=d.'employee_id' WHERE e.'department_name' IS NULL;
![]()
Full outer join
Query... In two tables A And B matching ,A Mismatch B,B Mismatch A The data of
(MYSQL,SQL99) Method 1 : The left outer join ( Right connection ) and B⊕ A(A⊕ B) Two part use UNION ALL sentence
SELECT employee_id,department_name FROM employee e LEFT JOIN departments d ON e.'employee_id'=d.'department_name'; UNION ALL SELECT employee_id,department_name FROM employee e RIGHT JOIN departments d ON e.'employee_id'=d.'employee_id' WHERE e.'department_name' IS NULL;
(Oracle,SQL99) Method 2 :FULL JOIN sentence
SELECT employee_id,department_name FROM employee e FULL JOIN departments d ON e.'employee_id'=d.'department_name';
(A⊕ B) ∪ (B⊕ A)
SELECT employee_id,department_name
FROM employee e LEFT JOIN departments d
ON e.'employee_id'=d.'employee_id'
WHERE d.'department_name' IS NULL;
UNION ALL
SELECT employee_id,department_name
FROM employee e RIGHT JOIN departments d
ON e.'employee_id'=d.'employee_id'
WHERE e.'department_name' IS NULL;
边栏推荐
- Window management learn more about windowmanagerservice
- International multilingual sea mall rebate product automatic matching order source code
- MySQL基础篇常用约束总结下篇
- NGUI,冷却效果
- Ngui, select gender male and female
- Summary of common constraints in MySQL foundation part I
- C#入门系列(十一) -- 多维数组
- Cas de rectification du CEM rayonné par des équipements électroniques
- Hardware Description Language HDL
- 地铁路线图云开发小程序源码和配置教程
猜你喜欢

Arbitrum 基础架构:快速入门

详述用网络分析仪测量DC-DC和PDN

Using ribbon to realize client load balancing

Pl/sql compilation check in kingbasees

NFT 2.0: the next generation of NFT will be lean and trustworthy

MOSFET的SOA或者ASO是什么?

安装MySQL ,出现由于找不到 MSVCR120.dll,无法继续执行代码解决方法”

用真金做的电路板——金手指

Kingbasees create database objects in batch

Dimension types for different CV tasks
随机推荐
Waiting event enq: Ko - some feasible processing methods for fast object checkpoint
硬件描述语言HDL
详解2.5G/5G/10G Base-T以太网接口物理层一致性测试!
Summary of common constraints in MySQL foundation part I
About CI framework batch export to compressed file
C语言课程设计
Cadence OrCAD capture design method to avoid misoperation graphic tutorial
基于C语言实现比赛评分系统
< Pytorch series 4 & gt;: Constructing neural network model
Cas de rectification du CEM rayonné par des équipements électroniques
jszip 获取上传的zip包中的指定文件的file
微信云开发Al短视频一键换脸小程序源码
【CV基础】颜色:RGB/HSV/Lab
Preview component packaging graphic tutorial in cadence OrCAD capture schematic design interface
国际多语言出海商城返佣产品自动匹配订单源码
iPhone 15 被迫用上 Type-C 接口
NFT将改变元宇宙中的数据所有权
Leetcode 1995. 统计特殊四元组(暴力枚举)
Unity字体间距
NFT 2.0: 下一代的NFT将是精简且值得信赖的NFT








