Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

Interactive SQL Online Help Interactive SQL Version 16.0 » Query Editor Help

Joins tab

Use this tab if you have more than one table in your query.

When you include more than one table in a query, the tables must somehow be joined. This tab allows you to define your joins.

Default joins

When you specify tables in the Tables tab, the Query Editor tries to generate a default join condition. It does this for two reasons. First, the Query Editor processes the query as you create it. If there is no default join, the tables create a cross product, and this can result in slow processing. Secondly, the Query Editor suggests a join strategy that might work for you.

If you add tables in the Query Editor Tables tab, the Query Editor checks to see if a foreign key relationship has been created between the tables. If there is one foreign key, it uses it to generate an ON condition. If there is more than one foreign key relationship, it uses the first one it finds. If there are no foreign keys, it does not generate an ON clause and the tables become a cross product.

You can always review your query by clicking the SQL tab, which is located at the bottom of the Query Editor dialog. You can edit your join strategy directly on the SQL tab, or you can use the Joins tab user interface to change it.

NoteAll the fields in the Joins tab are resizable. You can also expand the Query Editor by pulling on its edges. You may need to resize the fields and dialog in order to read your table names.

Dialog components

Using the joins tab

When you add more than one table to a query, the Query Editor attempts to create a default join strategy. If it cannot find a foreign key relationship between the tables, the default is a cross product. In most cases, cross products are not desirable.

To add or edit the join strategy, choose a table, a join type, and another table, all from the dropdown lists. Alternatively, click the SQL tab and edit the code directly.

Additional information

For more information, see Introducing the Query Editor.