Join tables in a SELECT statement

Use the Join Tables window to join tables in a SELECT statement.

You must select more than one table for a SELECT statement before you can join tables.

The Join Tables window assists you in performing joins on two or more selected tables. Tables that you selected in the FROM (Source tables) node are listed, and tables that can be joined together are indicated. You can specify join types or select from suggested join types. You can view details for each table including column names, data types, primary keys, and whether columns are nullable.

These steps are part of the larger task of creating a SELECT statement. When you complete the steps for joining tables in a SELECT statement, return to Create a SELECT statement.

To join tables in a SELECT statement:

  1. In the Details area for the FROM (Source tables) node, click Join Tables to open the Join tables window. If no primary/foreign key relationships exist between the tables that you selected in the FROM (Source tables) node, a message appears informing you that no join conditions will be suggested in the Join Tables window, and some of the features described below are not available.
  2. Optional: Keep the Suggest join conditions when joining check box selected to activate a function that will suggest potential join paths when you join tables together.
  3. Select a table in the Joins area. If any of the other tables in the Joins area are potential candidates for a join with this table, the icon next to these tables changes to a .
  4. Hold down the Shift key or the Ctrl key and select another table.
  5. Click Join.
  6. Optional: Change the join type.
  7. Optional: Edit the join conditions.
  8. Optional: Add another table to the join by selecting a join in the Joins area and following steps 4 through 7 above.
  9. Optional: Combine two joins by selecting two tables that are already joined in the Joins area and following steps 5 through 7 above.
  10. Click OK. All valid joins are added to the SQL code view.

Return to Create a SELECT statement.