Prepare for your Next Interview
This is a discussion on Outer Join Query Example within the SQL forums, part of the Databases category; 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?...
|
|||
|
Outer Join Query Example
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?
|
| Sponsored Links |
|
|||
|
Re: Outer Join Query Example
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. |
|
|||
|
Re: Outer Join Query Example
Quote:
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 |
|
|||
|
Re: Outer Join Query Example
Code:
select emp.ename,emp.empno,emp.deptno from emp full outer join dept on emp.deptno= dept.deptno |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| difference between Union All and full outer join | bvani | MY SQL | 5 | 10-23-2008 05:29 PM |
| SQL Server outer join | chitrab | SQL Server | 3 | 03-28-2008 04:51 AM |
| calculating the sum of a field in a query with join | 3roses | Oracle | 2 | 09-05-2007 01:17 PM |
| Writing query with LEFT OUTER JOIN | N SRIRAM K | Data Warehousing | 5 | 09-03-2007 06:08 AM |
| Join Query without using NOT IN subquery | Geek_Guest | SQL | 1 | 03-07-2007 04:24 PM |