这个 SQL 语句“WHERE table_a.key (+)= table_b.key"是什么意思?方法? [英] What does this SQL statement "WHERE table_a.key (+)= table_b.key" means?
问题描述
我正在阅读学校的一些讲义,我看到了这张幻灯片:
I am reading through some lecture notes of my school, and I come across this slide:
章节:数据集成和 ETL 流程
Chapter: Data Integration and ETL Process
幻灯片标题:重复值问题
文本:重复值总是存在.消除可能很耗时,尽管这是一项简单的任务.
Text: Duplicate values invariably exist. Eliminating can be time consuming, although it is a simple task to perform.
SQL 示例:
SELECT ...
FROM table_a, table_b
WHERE table_a.key (+)= table_b.key
UNION
SELECT ...
FROM table_a, table_b
WHERE table_a.key = table_b.key (+);
具体来说,我不明白(+)=
和最后一个(+)
的含义.
Specifically, I do not understand the meaning of the (+)=
and the last (+)
.
感谢您的帮助!
推荐答案
这意味着您应该停止使用带有 where
子句中的条件的旧式连接,并且 always使用显式 join
语法.
It means you should stop using old-style joins with the condition in the where
clause and always use explicit join
syntax.
对于您的特定查询,等效于 full outer join
:
For your particular query, the equivalent is full outer join
:
SELECT ...
FROM table_a FULL OUTER JOIN
table_b
ON table_a.key = table_b.key;
这篇关于这个 SQL 语句“WHERE table_a.key (+)= table_b.key"是什么意思?方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!