5

I'm using Oracle SQL Developer to query an Oracle DB (not sure which version it is) and I'm going to use the SQL I make for a Crystal report. Many of the reports the previous developers have written don't use JOIN keywords to make the joins (and I'm not too familiar with JOIN keywords as a result).

Many of the joins they make are made in the WHERE statement. I'll notice something like this.

Select * From TableA, TableB WHERE TableA.PrimaryKey(+) = TableB.ForeignKey

My question is concerning the (+). What purpose does it serve and how do I use it in my code?

mandroid
  • 2,308
  • 5
  • 24
  • 37

4 Answers4

8

It is not recommended. See this previous answer

Difference between Oracle's plus (+) notation and ansi JOIN notation?

Community
  • 1
  • 1
BobbyShaftoe
  • 28,337
  • 7
  • 52
  • 74
8

That represents a “right outer join” (right because the = is on the right side of the +).

SELECT *
FROM TableA, TableB
WHERE TableA.PrimaryKey(+) = TableB.ForeignKey

is equivalent to

SELECT *
FROM TableA
RIGHT OUTER JOIN TableB
  ON (TableA.PrimaryKey = TableB.ForeignKey)
Rory O'Kane
  • 29,210
  • 11
  • 96
  • 131
Michael Todd
  • 16,679
  • 4
  • 49
  • 69
3

right outer join

softveda
  • 10,858
  • 6
  • 42
  • 50
0

(+) is used to perform right outer join in Oracle RIGHT OUTER JOIN is one of the JOIN operations that allow you to specify a JOIN clause For details http://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj57522.html

pravin kottawar
  • 153
  • 2
  • 5
  • 16