CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2000
    Posts
    1,471

    What is the difference between inner join and outer join?

    I found that the resultant table after inner join and outer join from the same two joining tables could be the same. So what is the essential difference between inner join and outer join? Thanks for your inputs.

  2. #2
    Join Date
    Jan 2003
    Location
    North Carolina
    Posts
    309

    Re: What is the difference between inner join and outer join?

    Quote Originally Posted by dullboy
    I found that the resultant table after inner join and outer join from the same two joining tables could be the same. So what is the essential difference between inner join and outer join? Thanks for your inputs.
    INNER JOIN means that any data that is matched in the ON clause has to be matched btween both tables. So say one tabl has Bob, Jeb, and Fred and the other has Bill, Bob and Fred and you join on first name. INNER JOIN will find a mtch for only Bob and Fred in both tables thus Bill and Jeb will not be apart of the output.

    OUTER JOIN depedning on RIGHT, LEFT or FULL will return all data from the reference tabled (LEFT being the first table named bfore the join predicate, RIGHT being the one right after and FULL being both). So a LEFT OUTER JOIN with the prvious conditions where Jeb is in the first table before the join predicate will result in the records for Bob, Jeb and Fred but not Bill.

    Kinda late so I hope this makes sense.

  3. #3
    Join Date
    Aug 2000
    Posts
    1,471

    Re: What is the difference between inner join and outer join?

    Thanks for your explaination and examples.
    Quote Originally Posted by antares686
    INNER JOIN means that any data that is matched in the ON clause has to be matched btween both tables. So say one tabl has Bob, Jeb, and Fred and the other has Bill, Bob and Fred and you join on first name. INNER JOIN will find a mtch for only Bob and Fred in both tables thus Bill and Jeb will not be apart of the output.

    OUTER JOIN depedning on RIGHT, LEFT or FULL will return all data from the reference tabled (LEFT being the first table named bfore the join predicate, RIGHT being the one right after and FULL being both). So a LEFT OUTER JOIN with the prvious conditions where Jeb is in the first table before the join predicate will result in the records for Bob, Jeb and Fred but not Bill.

    Kinda late so I hope this makes sense.

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

Featured