Results 1 to 5 of 5

Thread: Outer Join Query Example

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    2

    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?


  2. #2
    Junior Member
    Join Date
    Feb 2008
    Answers
    15

    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.


  3. #3
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Outer Join Query Example

    Quote Originally Posted by mailtos.ravi View Post
    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?

    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


  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Outer Join Query Example

    just try this sample query

    select * from emp full outer join dept using (deptno)


  5. #5
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    Re: Outer Join Query Example

    Code:
    select emp.ename,emp.empno,emp.deptno from emp full outer join dept on emp.deptno= dept.deptno
    the full outer join returned unmatched results for both tables. Depending on the database unmatched records will be displayed with a blank or a null.
    Quote Originally Posted by mailtos.ravi View Post
    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?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact