Home » RDBMS Server » Server Administration » inner joint
inner joint [message #372157] Tue, 16 January 2001 16:43 Go to next message
elsie
Messages: 1
Registered: January 2001
Junior Member
how do i write an INNER JOIN
in oracle
Re: inner joint [message #372158 is a reply to message #372157] Tue, 16 January 2001 17:32 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
Oracle only has 2 variations:

The usual join...
select x.col1, y.col2, z.col3
from table1 x, table2 y, table3 z
where x.joincol1 = y.joincol1
and y.joincol2 = z.joincol2
etc.

or the outer join...
select x.col1, y.col2, z.col3
from table1 x, table2 y, table3 z
where x.joincol1 = y.joincol1 (+)
and y.joincol2 = z.joincol2

The (+) indicates the side which the outer join is made on. In this case rows in x will be returned even if there is no corresponding row in y. The other way around it looks like:
where x.joincol1 (+) = y.joincol1

If you join more than one col between the 2 tables, each join needs the (+). i.e.

where t1.col1 = t2.col1 (+)
and t1.col2 = t2.col2 (+)
Previous Topic: SYNTAX HELP!
Next Topic: require solution for Deleting from Tables urgent....
Goto Forum:
  


Current Time: Sat May 18 00:35:44 CDT 2024