Question.. [message #8107] |
Sun, 27 July 2003 23:54 |
Saahil
Messages: 10 Registered: November 2001
|
Junior Member |
|
|
HI All,
May I know as to what is the purpose of giving an Outer Join.
Regards,
Mubeen.
|
|
|
Re: Question.. [message #8109 is a reply to message #8107] |
Mon, 28 July 2003 00:03 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
From the Oracle Docs.
----------------------------------------------------------------------
An outer join extends the result of a simple join. An outer join returns all rows that satisfy the join condition and also returns some or all of those rows from one table for which no rows from the other satisfy the join condition.
To write a query that performs an outer join of tables A and B and returns all rows from A (a left outer join), use the LEFT [[OUTER]] JOIN syntax in the FROM clause, or apply the outer join operator (+) to all columns of B in the join condition in the WHERE clause. For all rows in A that have no matching rows in B, Oracle returns null for any select list expressions containing columns of B.
To write a query that performs an outer join of tables A and B and returns all rows from B (a right outer join), use the RIGHT [[OUTER]] JOIN syntax in the FROM clause, or apply the outer join operator (+) to all columns of A in the join condition in the WHERE clause. For all rows in B that have no matching rows in A, Oracle returns null for any select list expressions containing columns of A.
To write a query that performs an outer join and returns all rows from A and B, extended with nulls if they do not satisfy the join condition (a full outer join), use the FULL [[OUTER]] JOIN syntax in the FROM clause.
----------------------------------------------------------------------
HTH,
MHE
|
|
|