DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Diff between Outer and inner Join

  1. #1
    Join Date
    Mar 2001
    Posts
    188
    Hello
    i have a simple question.
    What is different zwischen an outer join and an inner join (equi-joins). The outer join is clear beause there is an + in the where clause.
    Give me some example

    [Edited by tomate on 06-28-2001 at 06:51 AM]
    Best Regards
    Thomas Schmidt

    Thomas_Schmidt@eplus-online.de
    If you have no aims, you will never reach a goal !!!

  2. #2
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    suppose you have 2 tables :
    departments (dept_id, dept_name)
    containing :
    10,MATHS
    20,FRENCH
    30,ORACLE
    and teachers (name, dept_id)
    containing :
    SMITH,10
    PIPO,30

    if you do the following query, which uses a simple join (or inner join) :

    select dept_name, name
    from departements, teachers
    where departements.dept_id = teachers.dept_id;

    you will have only the lines that meet the criteria, that is to say that you'll have :

    MATHS SMITH
    ORACLE PIPO

    but you do not see the departement 20.
    if you want to see it whereas there is a corresponding teacher or not, you'll use an outer join :

    select dept_name, name
    from departements, teachers
    where departements.dept_id = teachers.dept_id(+);

    so now if there is a departement that does not meet the criteria, dept_name will be returned, and name will be NULL ...
    you'll get the result :

    MATHS SMITH
    FRENCH
    ORACLE PIPO

    this is the difference between a join (or inner join) and an outer join

  3. #3
    Join Date
    Jan 2001
    Posts
    153
    Hi

    inner Join !!! I DONN think there is an terminology like that...
    In a join, one row set is called inner, and the other is called outer..so if u specify the (+) then it means that there is a strech in the data for the Join..so it is just an simple join and outer join..

    Vijay.s

  4. #4
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809

    Thumbs up

    exact, but people who worked with Access use the term 'inner join' instead of simple join

  5. #5
    Join Date
    Jan 2001
    Posts
    153
    oh yeah...i wasnt working on access !! sorry !!
    Vijay.s

  6. #6
    Join Date
    Jan 2001
    Posts
    318
    There are lot of threads in this forum which discusses this.. Please search this forum for outer join !

    thanks
    Sonali

  7. #7
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    Well, it's not just Access - it's called SQL-92 standard SQL and Oracle is simply a little late implementing in - like an entire Decade!!!! But don't worry - you will become familiar with it soon enough, as they are finally supporting the standard in 9i.

    - Chris

  8. #8
    Join Date
    Mar 2001
    Posts
    188
    Thanks for the help.
    The best information was that an inner join is a simple join.
    I think i have something missed but it is an simple join.
    About this thematik i have learn much but i'm not known somethin about inner join. Ok it comes from access.

    Thanks for the very good help
    Best Regards
    Thomas Schmidt

    Thomas_Schmidt@eplus-online.de
    If you have no aims, you will never reach a goal !!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width