Joining Tables

Use the Join page of the SQLAssist SmartGuide to join tables in an SQL statement. The join page displays the columns of each table selected in the Tables page.


Join page of SQLAssist SmartGuide

Requesting a join

  1. Select one of the displayed columns in a table. The informational area indicates the status of the join.

  2. Select a displayed column in another table. A line appears connecting the columns to indicate the requested join. Notice that the information area is updated. The information area also indicates if a requested join is invalid (for instance, because of a mismatch in the data type of the columns). The control buttons on the join page are also enabled.


    Joined tables

    By default, a join request is assumed to be an inner join. An inner join requests only the rows where the values of the two columns match. You can also request other types of joins by selecting Options. You can select:

    Inner join is also an option. You can choose this if want to change a join type from a left or right outer join.

  3. Select Join. The color of the join line changes to red indicating that the join is enabled.

Requesting additional joins

You can request additional joins in the same way as the initial join. You can join other displayed columns in the same tables or in other tables. If you request multiple joins, you can navigate between the joins by selecting > or <. The selected join is indicated by a red join line.

Joining a table alias

You can join a column in a table with a column of an alias. An alias is an alternate name for a table. Joining a column to an alias gives you a way of joining two columns in the same table. You can do this as follows:

  1. Select the column for the join in the table.

  2. Select Alias. This creates an alias for the selected table and displays its columns. These are the same columns as the associated table.

  3. Select a column in the alias.

  4. Select Options if you want to change the type of join.

  5. Select Join

Removing a join

To remove a join, select the joined columns or navigate to the pertinent join. Then select Unjoin. The join line is removed.

When you finish the join

When you finish the join specification, select Next. This displays the Condition 1 page of the SQLAssist SmartGuide. Use this page to specify a search condition for the SQL statement.

Select Back to display the Tables page of the SQLAssist SmartGuide. If appropriate, you can then change the tables selected for the query.

You can also display any page in the SQL Assist SmartGuide by selecting its tab.

When you complete the specification of your SQL statement, select Finish. This generates the code for the SQL statement and closes the SQLAssist SmartGuide.

To cancel the visual composition of the SQL statement, select Cancel.