Friday, January 22, 2010

Introduction to Join in SQL/400

JOIN
Types of JOIN
Inner JOIN
Equal-join
Natural join
Cross join / Cartesian join
Outer JOIN
Left Outer join
Right Outer join
Full Outer join
Self JOIN

What is Join?

SQL JOIN is the clause in the SQL which combines the records from two or more table in a database.

What is Inner join

1.It is the most common join operation and represented as default join type.
2.Inner join will create the a new table by combining the values of two table
depending upon predicates.

Inner join Classification
1.Explicit inner join.
2.Implicit inner join.

1. Explicit Inner Join

SELECT * FROM Employee INNER JOIN Department ON Employee.Department_ID = Department.Department_ID

2. Implicit Inner join

SELECT * FROM Employee, Department WHERE Employee.Department_ID = Department.Department_ID

1 comment: