outer join and inner join

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    #1

    outer join and inner join

    Hii guys,
    I might be silly to ask this ques..but seriously i did not understand the outer join and inner join in mysql site.i understood left and right join also.
    can some one explain outer and inner join with some basic definition and example plzz..and also unique key.


    thanks,
    Pradeep
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    Check out NeoPa's SQL JOINs article in the Access HowTo section.

    Even tho it is written for Access, the principles are pretty much the same.

    Note, however, that the OUTER JOIN he describes does not work in MySQL.
    To simulate that, you could try something like:
    [code=mysql]
    SELECT * FROM a
    LEFT JOIN b ON a.id = b.id
    UNION
    SELECT * FROM a
    RIGHT JOIN b ON a.id = b.id;
    [/code]
    Last edited by Atli; Nov 8 '08, 07:57 AM. Reason: Added the bit about how to simulate the OUTER JOIN

    Comment

    Working...