[sql] What does a (+) sign mean in an Oracle SQL WHERE clause?

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

Consider the simplified SQL query below, in an Oracle database environment (although I'm not sure that it's Oracle-specific):

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

What is that (+) notation for in the WHERE clause? I'm sorry if this is an ignorant newbie question, but it's been extremely difficult to search for on Google or StackOverflow... because even when using quote marks, search engines see a '+' sign and seem to want to treat it as some kind of a logical directive.

This question is related to sql oracle

The answer is


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.

In standard SQL one would write:

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

Oracle recommends not to use those joins anymore if your version supports ANSI joins (LEFT/RIGHT JOIN) :

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 […]