MySQL Forums
Forum List  »  Newbie

Re: INNER JOIN is RIGHT JOIN and OUTER JOIN is LEFT JOIN
Posted by: Ekta Goel
Date: May 23, 2007 01:15AM

An inner join essentially combines the records from two tables A and B based on a given join predicate.

Outer joins do not require that each record in the two joined tables has a matching record in the other table. The record is retained in the joined table if no matching other record exists. Outer joins are subdivided further into left outer joins, right outer joins, and full outer joins, depending from which table the rows shall be retained (left, right, or both).

he result of a left outer join for tables A and B always contains all records of the "left" table (A), even if the join condition does not find any matching record in the "right" table (B).

A right outer join is much like a left outer join, except that the tables are reversed. Every record from the "right" table (B) will be in the joined table at least once.

A full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side.

So to summarise:::
Inner Join:
Inner join gives the result common to both the tables.
Outer join:
Left Join, Right Join and Full Outer Join.

Options: ReplyQuote


Subject
Written By
Posted
Re: INNER JOIN is RIGHT JOIN and OUTER JOIN is LEFT JOIN
May 23, 2007 01:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.