Instead of using keywords like FULL OUTER JOIN or FULL JOIN, how can I perform full outer join using 'where' clause with the help of '+' operator?!
The syntax for the Oracle FULL OUTER JOIN is: SELECT columns FROM table1 FULL [OUTER] JOIN table2 ON table1. column = table2.
What is full outer join in Oracle? A full outer join performs a join between two tables that returns the results of an INNER join as well as the results of a left and right outer join.
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.
The FULL OUTER JOIN keyword returns all records when there is a match in left (table1) or right (table2) table records. Tip: FULL OUTER JOIN and FULL JOIN are the same.
You can't (at least directly). Oracle only supports a full outer join using SQL:1999 syntax.
You can fake it by unioning two outer joins:
select a.field1, b.field2
from table_a a, table_b b
where a.id = b.id(+)
union all
select a.field1, b.field2
from table_a a, table b b
where a.id(+) = b.id
and a.id is null
It's a lot more readable using the SQL:1999 syntax:
select a.field1, b.field2
from table_a a full outer join table_b b
on a.id = b.id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With