且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Oracle SQL WHERE子句中的(+)符号是什么意思?

更新时间:2021-09-14 09:30:44

这是外部连接的Oracle特定表示法.这意味着它将包含来自t1的所有行,如果t0中没有对应的行,则在t0列中使用NULL.

This is an Oracle-specific notation for an outer join. It means that it will include all rows from t1, and use NULLS in the t0 columns if there is no corresponding row in t0.

在标准SQL中,人们会这样写:

In standard SQL one would write:

SELECT t0.foo, t1.bar
  FROM FIRST_TABLE t0
 RIGHT OUTER JOIN SECOND_TABLE t1;

Oracle 建议不要再使用这些联接如果您的版本支持ANSI连接(左/右连接):

Oracle建议您使用FROM子句OUTER JOIN语法,而不要使用Oracle join运算符.使用Oracle联接运算符(+)的外部联接查询受以下规则和限制[…]

Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator. Outer join queries that use the Oracle join operator (+) are subject to the following rules and restrictions […]