当前位置:网站首页>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;
边栏推荐
- 概率论:计算置信区间
- Development and source code construction of digital collection system
- [Objective-C] dynamically create controls
- 【MYSQL】存储过程的使用
- MXNet对AlexNet模型的构建与实现(与LeNet的对比)
- Batch add noise to data and generate new named annotation files
- Ngui, map zoom in and out
- 国际多语言出海商城返佣产品自动匹配订单源码
- Implementing declarative rest calls using feign
- C语言课程设计
猜你喜欢

MOSFET的SOA或者ASO是什么?

Leetcode 1995. Statistics special quads (brute force enumeration)

Circuit board made of real gold -- golden finger

解读USB3.0测试项目
![[machine learning theory] true positive, true negative, false positive, false negative concept](/img/59/8264d6cbd96480b59e5b8ff96320be.png)
[machine learning theory] true positive, true negative, false positive, false negative concept

【CV基础】颜色:RGB/HSV/Lab

为什么DDRx的电源设计时需要VTT电源
Implementing declarative rest calls using feign

Cadence OrCAD capture design method to avoid misoperation graphic tutorial

MYSQL(九)
随机推荐
[Objective-C] differences between structs and classes
Metro roadmap cloud development applet source code and configuration tutorial
【K-Means】K-Means学习实例
About CI framework batch export to compressed file
数字藏品系统开发源码搭建
【Objective-C】‘NSAutoreleasePool‘ is unavailable: not available in automatic reference counting mode
云画质助手iApp源码
电子设备辐射EMC整改案例
Dimension types for different CV tasks
Use of JMeter (simulating high concurrency)
【机器学习理论】True Positive, True Negative, False Positive, False Negative概念
金仓数据库KingbaseES中的PL/SQL 编译检查
[Objective-C] dynamically create controls
Leetcode 1961. 检查字符串是否为数组前缀
Safety related website recommendations
数字藏品app系统源码
概率论:计算置信区间
Using ribbon to realize client load balancing
NewOJ Week 2---BCD
安装MySQL ,出现由于找不到 MSVCR120.dll,无法继续执行代码解决方法”







