Creating joins in the SQL Query Builder

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 Query Builder to define the join conditions.

Before you begin

SQL support for joins in the SQL Query 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 Query Builder to create joins, the tool attempts to create the correct syntax for the database vendor that you are using.

The SELECT statement must be open in the SQL Query Builder, with two or more tables specified in the Tables pane.

Procedure

To create a join in the SQL Query Builder:

Create a join by dragging or by using a pop-up menu:
To create a join by dragging
  1. 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).
  2. 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
  1. Right-click in the Tables pane, and then click Create Join on the pop-up menu.
  2. In the Create Join window, select the source table (first table) and column.
  3. Select the target table (second table) and column.
  4. Select the join type, and then click OK.

Feedback