What does the (+) sign mean in an Oracle SQL WHERE clause?

Possible duplicate:
Oracle: What does (+) in a WHERE clause?

Consider the simplified SQL query below in an Oracle database environment (although I'm not sure if it depends on Oracle):

 SELECT t0.foo, t1.bar FROM FIRST_TABLE t0, SECOND_TABLE t1 WHERE t0.ID (+) = t1.ID; 

What is the (+) notation for a WHERE ? I apologize if this is an uninformed question about newbies, but it was extremely difficult to find on Google or StackOverflow ... because even when using quotes, search engines see the β€œ+” sign and seem to want to treat it as something like a logical directive .

+44
sql oracle
Nov 18 '10 at 16:41
source share
1 answer

This is an Oracle-oriented notation for external joins. This means that it will include all rows from t1 and use NULLS in t0 columns if there is no corresponding row in t0.

In standard SQL, one could write:

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

Oracle recommends no longer using these joins if your version supports ANSI connections (LEFT / RIGHT JOIN) :

Oracle recommends using the FROM syntax instead of the OUTER JOIN instead of the Oracle join operator. External join requests using the Oracle (+) join operator obey the following rules and restrictions [...]

+38
Nov 18 2018-10-18
source share



All Articles