What is the different between an INNER and OUTER join?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: What is the different between an INNER and OUTER join?

Hybrid View

  1. #1
    Chris Salmon Guest

    What is the different between an INNER and OUTER join?


    Can someone explain to me the different tbetween an INNER and OUTER join?

    Also how to use the LEFT/RIGHT keywords for joins?

    If there is an doc written up anywhere please provide that link.

    Thank you!

    Chris

  2. #2
    David Satz Guest

    Re: What is the different between an INNER and OUTER join?

    read up in SQL books online (BOL) under "Using Inner Joins" and "Using Outer
    Joins"
    --
    HTH,
    David Satz
    Principal Web Engineer
    Hyperion Solutions
    { SQL Server 2000 SP1/7.0 SP3/6.5 SP5a } { Cold Fusion 5/4.5.1 SP2 } { VSS }
    (Please reply to group only - emails answered rarely)
    -----------------------------------------------------------------
    "Chris Salmon" <csalmon@yahoo.com> wrote in message
    news:3c766bb5$1@10.1.10.29...
    >
    > Can someone explain to me the different tbetween an INNER and OUTER join?
    >
    > Also how to use the LEFT/RIGHT keywords for joins?
    >
    > If there is an doc written up anywhere please provide that link.
    >
    > Thank you!
    >
    > Chris




  3. #3
    Chris Salmon Guest

    Re: What is the different between an INNER and OUTER join?


    Where can I find that, what is the link?

    "David Satz" <davidNOSPAMsatz@yahoo.com> wrote:
    >read up in SQL books online (BOL) under "Using Inner Joins" and "Using Outer
    >Joins"
    >--
    >HTH,
    >David Satz
    >Principal Web Engineer
    >Hyperion Solutions
    >{ SQL Server 2000 SP1/7.0 SP3/6.5 SP5a } { Cold Fusion 5/4.5.1 SP2 } { VSS

    }
    >(Please reply to group only - emails answered rarely)
    >-----------------------------------------------------------------
    >"Chris Salmon" <csalmon@yahoo.com> wrote in message
    >news:3c766bb5$1@10.1.10.29...
    >>
    >> Can someone explain to me the different tbetween an INNER and OUTER join?
    >>
    >> Also how to use the LEFT/RIGHT keywords for joins?
    >>
    >> If there is an doc written up anywhere please provide that link.
    >>
    >> Thank you!
    >>
    >> Chris

    >
    >



  4. #4
    David Satz Guest

    Re: What is the different between an INNER and OUTER join?

    it comes with SQL Server client utils or you can search for it in
    http://www.msdn.microsoft.com/librar.../en-us/startsq
    l/getstart_4fht.asp
    "Chris Salmon" <csalmon@yahoo.com> wrote in message
    news:3c768629$1@10.1.10.29...
    >
    > Where can I find that, what is the link?
    >
    > "David Satz" <davidNOSPAMsatz@yahoo.com> wrote:
    > >read up in SQL books online (BOL) under "Using Inner Joins" and "Using

    Outer
    > >Joins"
    > >--
    > >HTH,
    > >David Satz
    > >Principal Web Engineer
    > >Hyperion Solutions
    > >{ SQL Server 2000 SP1/7.0 SP3/6.5 SP5a } { Cold Fusion 5/4.5.1 SP2 } {

    VSS
    > }
    > >(Please reply to group only - emails answered rarely)
    > >-----------------------------------------------------------------
    > >"Chris Salmon" <csalmon@yahoo.com> wrote in message
    > >news:3c766bb5$1@10.1.10.29...
    > >>
    > >> Can someone explain to me the different tbetween an INNER and OUTER

    join?
    > >>
    > >> Also how to use the LEFT/RIGHT keywords for joins?
    > >>
    > >> If there is an doc written up anywhere please provide that link.
    > >>
    > >> Thank you!
    > >>
    > >> Chris

    > >
    > >

    >




  5. #5
    Sathish Guest

    Re: What is the different between an INNER and OUTER join?


    Hi,
    Left Outer join is a joint operator what you can use to link two tables
    where you can get all rows in the left table whether you have or not the
    matching row in the right table on a particular key.
    clause usage"table_a left outer join table_b on table_a.id = table_b.id "

    Simillar but vice versa for right outer join.

    Sathish



    "Chris Salmon" <csalmon@yahoo.com> wrote:
    >
    >Can someone explain to me the different tbetween an INNER and OUTER join?
    >
    >Also how to use the LEFT/RIGHT keywords for joins?
    >
    >If there is an doc written up anywhere please provide that link.
    >
    >Thank you!
    >
    >Chris



  6. #6
    Daron Guest

    Re: What is the different between an INNER and OUTER join?


    Chris, does this make sense to you ????

    LEFT JOIN (aka LEFT OUTER JOIN) returns all records from the left-hand table,
    matching records on the right-hand table and NULLs if there are no matches
    on the right-hand table
    SELECT "select statement goes here"
    FROM table1 alias1
    LEFT JOIN table2 alias2
    ON alias1.column = alias2.column
    [WHERE aliasn.column=condition]

    RIGHT JOIN (aka RIGHT OUTER JOIN) returns all records from the right-hand
    table, matching records on the left-hand table and NULLs if there are no
    matches on the left-hand table
    SELECT "select statement goes here"
    FROM table1 alias1
    RIGHT JOIN table2 alias2
    ON alias1.column = alias2.column
    [WHERE aliasn.column=condition]

    INNER JOIN returns only the records that match in both tables
    SELECT "select statement goes here"
    FROM table1 alias1 , table2 alias2
    WHERE alias1.column = alias2.column

    FULL JOIN (aka FULL OUTER JOIN) returns all records in both tables, matches
    up rows and substitutes NULLS for any rows that do not have a "partner" in
    the other table

    CROSS JOIN (aka Cartesian product) returns all rows in the left hand table,
    matching each row with *all* rows from the right-hand table



    "Chris Salmon" <csalmon@yahoo.com> wrote:
    >
    >Can someone explain to me the different tbetween an INNER and OUTER join?
    >
    >Also how to use the LEFT/RIGHT keywords for joins?
    >
    >If there is an doc written up anywhere please provide that link.
    >
    >Thank you!
    >
    >Chris



  7. #7
    SadiQ Guest

    Re: What is the different between an INNER and OUTER join?


    Joins stem from set theory in good old maths. Some revision on Venn diagrams
    will help you to picture this more clearly than just thinking about how one
    table joins to the next. As always, practice is what counts, so for a good
    online tutorial, go to :http://www.arsdigita.com/books/sql/
    It's one of the better sites that i've come accross, and also has reference
    to a good practical book on SQL.

    SadiQ
    All Praise is due to Allah

    "Chris Salmon" <csalmon@yahoo.com> wrote:
    >
    >Can someone explain to me the different tbetween an INNER and OUTER join?
    >
    >Also how to use the LEFT/RIGHT keywords for joins?
    >
    >If there is an doc written up anywhere please provide that link.
    >
    >Thank you!
    >
    >Chris



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center