A personal repository of technical notes. - CSC

SQL Join Types

[INNER] JOIN
All matching pairs of rows are returned. Discards unmatched rows from both tables. Default type of join.

LEFT [ OUTER ] JOIN
Specifies that all rows from the left table not meeting the join condition are included in the result set, and output columns from the other table are set to NULL in addition to all rows returned by the inner join.

RIGHT [OUTER] JOIN
Specifies all rows from the right table not meeting the join condition are included in the result set, and output columns that correspond to the other table are set to NULL, in addition to all rows returned by the inner join.

FULL [ OUTER ] JOIN
Specifies that a row from either the left or right table that does not meet the join condition is included in the result set, and output columns that correspond to the other table are set to NULL. This is in addition to all rows typically returned by the INNER JOIN.

See also FULL OUTER JOIN Not Working

CROSS JOIN
Cross joins return all rows from the left table. Each row from the left table is combined with all rows from the right table.

References

joins, using. "Join Fundamentals." MSDN – Explore Windows, Web, Cloud, and Windows Phone Software Development. N.p., n.d. Web. 13 Aug. 2012.
http://msdn.microsoft.com/en-us/library/ms191517%28v=sql.100%29

"Using Joins." MSDN – Explore Windows, Web, Cloud, and Windows Phone Software Development. N.p., n.d. Web. 13 Aug. 2012.
http://msdn.microsoft.com/en-us/library/ms191472%28v=sql.100%29

"Null Values and Joins." MSDN – Explore Windows, Web, Cloud, and Windows Phone Software Development. N.p., n.d. Web. 13 Aug. 2012.
http://msdn.microsoft.com/en-us/library/ms190409%28v=sql.100%29

No comments:

Post a Comment