If you select multiple columns in two or more tables in an SQL
statement, you need to specify how the rows of these columns are associated
in the join of the tables. You can use the SQL builder to define the join
conditions.
SQL support for joins in the SQL builder is dependent on the level
of support that is provided by your database vendor. There might be variations
in syntax depending upon the database vendor that you are using. If you use
the SQL builder to create joins, the tool attempts to create the correct syntax
for the database vendor that you are using.
Prerequisite: The
SELECT statement must be open in the SQL builder, with two or more tables
specified in the Tables pane.
To create a join in the SQL builder:
Create a join by dragging or by using a pop-up menu:
|
|
To create a join by dragging |
- In the Tables pane, drag the pointer from a column in one table (first
table) to the column that you want to create the join to in another table
(second table).
- Optional: To change the join type from the default inner join, right-click
the connection line and then click Specify Join Type on
the pop-up menu. In the Specify Join window, select the join type, and then
click OK.
|
To create a join by using a pop-up menu |
- Right-click in the Tables pane, and then click Create Join on
the pop-up menu.
- In the Create Join window, select the source table (first table) and column.
- Select the target table (second table) and column.
- Select the join type, and then click OK.
|