Joins

The heart of SQL in a relational system is the ability to perform relational joins. Joins are specified by using more than one table name in the FROM clause of a subselect. A joined table specifies an intermediate result table that is the result of either an inner join or an outer join.

Note

The maximum number of tables that can be joined by DB2 is 15 (or 255 if star join is selected), but there can be up to 225 table references in a SQL statement.

Inner Joins

The join operation used most often, which is the one we have been using in the book exercises, is known as an INNER JOIN. An inner join combines each row of the left table with every row of the right table keeping only the rows where the join condition is true. The result table may ...

Get DB2® Universal Database for OS/390® Version 7.1 Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.