DB2 graphic QMF Version 8

Join Conditions

You can add more than one table to a query. When you add an additional table to a query using the Tables dialog, the Join Conditions dialogs open automatically. There are two Join Conditions dialog windows:

The Join Tables dialog box contains the following fields:

Table 17. Join Tables Dialog
Field Description
Select a table to join into the query Lists the tables selected for the query. This table will be joined to another table based on the join condition.
Select the type of join to perform Select the type of join condition that will be used to connect the table listed to the previously selected table. You have four choices:
  • Inner Join
  • Right Outer Join
  • Left Outer Join
  • Full Outer Join
Inner join Only rows with matching values in both tables will be included in the results set. An INNER join is implicit if you do not specify any other join operator.
Note:
An inner join compares every row of the left table with every row of the right table keeping only the rows where the join-condition is true. The resulting table may be missing rows from either or both of the joined tables.
Left Outer join All rows in the left table, with matching rows from the right table, will be included.

Outer joins include the rows produced by the inner join as well as the missing rows, depending on the type of outer joins. A Left outer join includes the rows from the left table that were missing from the inner join.

Right Outer join All rows in the right table, with matching rows from the left table, will be included.

Outer joins include the rows produced by the inner join as well as the missing rows, depending on the type of outer joins. A Right outer join includes the rows from the right table that were missing from the inner join.

Full Outer join All rows from both tables will be included

For a FULL OUTER (or FULL) join, the join condition is a search condition in which the predicates can only be combined with AND. In addition, each predicate must have the form'expression = expression', where one expression references only columns of one of the operand tables of the associated join operator, and the other expression references only columns of the other operand table. The values of the expressions must be comparable.

Each full join expression in a FULL OUTER join must include a column name or a cast function that references a column. The COALESCE and VALUE functions are allowed.

Outer joins include the rows produced by the inner join as well as the missing rows, depending on the type of outer joins. A Full outer join includes the rows from both tables that were missing from the inner join.

Continue Click Continue to join the tables. The Join Columns dialog box opens.

Join Columns

Use the Join Columns dialog box to specify the columns that will used to link the tables. The columns from the current table that you are adding to the query and the columns from each table that is already included in the query are listed. Select a column from each list box with the same data type (NUMERIC, DATE, TIME, or CHARACTER). Rows that have equal values in those columns will be joined.

The Join Columns dialog box contains the following fields:

Table 18. Join Columns Dialog
Field Description
Columns of Lists all the columns that are included in the table that you are adding to the query. Select one column from this list.
Note:
Select a column with matching data types from each list.
Available columns to join Lists all the columns from the table or tables that are already included in the query. Select one column from this list.
Note:
Select a column with matching data types from each list.


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004