Archive for inner join

SQL Joins Simple Notes

Posted in SQL with tags , , , , , on February 17, 2009 by myleskadusale

INNER JOIN
Inner join only returns a result that will contain matching records from both tables.

OUTER JOIN
An outer join is the inverse of the inner join. It only returns those records not in both tables.

LEFT JOIN
A left join returns all the records in the “left” table whether they have a match in the right table or not.

If, however, they do have a match in the right table – give me the “matching” data from the right table as well. If not – fill in the holes with null.

RIGHT JOIN
A right join returns all the records in the “right” table whether they have a match in the left table or not.

If, however, they do have a match in the left table – give me the “matching” data from the left table as well. If not – fill in the holes with null.

FULL JOIN
Result will contain all records from both tables, and fill in NULLs for missing matches on either side

LEFT OUTER JOIN
A left outer join combines the ideas behind a left join and an outer join. Basically – if you use a left outer join you will get the records in the left table that DO NOT have a match in the right table.

RIGHT OUTER JOIN
A right outer join combines the ideas behind a right join and an outer join. Basically – if you use a right outer join you will get the records in the right table that DO NOT have a match in the left table.

I got this info from the net

Visual Explanation of Joins
‘Getting’ JOINS
Using MySQL JOINS
SQL JOIN
W3C Schools.com

Advertisements