Tuesday, December 09, 2008

SQL: Joins

The SQL JOIN clause is used whenever we have to select data from 2 or more tables. To be able to use SQL JOIN clause to extract data from 2 (or more) tables, we need a relationship between certain columns in these tables.

Inner Join (simple join)Chances are, you've already written an SQL statement that uses an inner join. It is the most common type of join. Inner joins return all rows from multiple tables where the join condition is met.

Outer JoinAnother type of join is called an outer join. This type of join returns all rows from one table and only those rows from a secondary table where the joined fields are equal (join condition is met).

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory