views:

114

answers:

3

Outer joins seem to me a little bit confusing.

Is there anyone can get me a clear picture of outer joins (right, left and full)?

+6  A: 

Org. question/ans : http://stackoverflow.com/questions/3308122/how-do-i-decide-when-to-use-right-join-left-join-or-inner-join-or-how-to-deter/3308153#3308153

read this orignal article on cp will help you lot : Visual Representation of SQL Joins

alt text

full article : http://www.codeproject.com/KB/database/Visual_SQL_Joins.aspx

Pranay Rana
Thnaks a lot Pranay.the diagram is really helpfull:-))
Gangu
+1  A: 

The Wikipedia article about Joins should help you.

The special thing about Oracle Outer joins was the old notation using (+), but it is obsolete now.

Peter Lang
Thnks a lot Peter...:-))))
Gangu
+1  A: 

The way I always think of it is:

LEFT JOIN - keeps all rows selected on the left
RIGHT JOIN - keeps all rows selected on the right
FULL JOIN - keeps all rows selected on both sides

Easy to keep in your head, without going to Wikipedia or drawing diagrams.

P.S. Death to Oracle + join syntax!

orbfish
thanks a lot orbfish..:-))
Gangu