Can any body give me query example to Full Outer join? I know for left, right outer join but i need how to write a full outer join query?
Can any body give me query example to Full Outer join? I know for left, right outer join but i need how to write a full outer join query?
A full outer join retrieves all the records in the both tables,
for example on two tables using the ON clause. The full outer join can retrieve the records on both tables even if the data not equals the data on the other table. Example script:
select e.last_name, d.Department_id, d.department_name
from employees e full outerjoin departments d
on (e.department_id = d.department_id);
IF your having Oracle database in your System run this query as it is
Bye sudheer.
Dear Ravi,
If you know how to write left and righ outer joins then writing full outer join is very simple. Just use the word full in place of left or right.
The only difference is
·Left Outer Join: Returns rows from both tables that satisfy the join condition, and the rest of rows from the first (left) table.
·Right Outer Join: Returns rows from both tables that satisfy the join condition, and the rest of rows from the second (right) table.
·Full Outer Join: Returns rows from both tables that satisfy the join condition, the rest of rows from the first (left) table, and the rest of rows from the second (right) table.
Regards
Krishna
just try this sample query
select * from emp full outer join dept using (deptno)