Previous Topic

Next Topic

Book Contents

Book Index

GUI Query Builder - GUI Tab

Access this window from the Gui tab of the Query Builder.

The Gui tab shows you:


Adding Tables to the Query

You can add tables to your query in the following ways:

Add Related Tables

This will add all tables known to be related to the currently-selected table. This includes:

If you only wish to select some (and not all) related tables, click on Add Table then go to the Select Known Relationships tab

A Table shows no columns?

If a completely empty table-box is displayed, this means that AQT has been unable to find the columns for the table. This may happen because the table is held on a different server, or because the table-name has been qualified in a way that AQT is unable to interpret.

Joining Tables

If you use Add Related Tables or Add New Table > Select Known Relationship, your tables will be joined automatically by AQT.

Otherwise you will need join the tables manually. You can do so by dragging columns between tables.

Join only columns of same type

Generally, you should only join columns which are of the same type. If you try to join columns of different types, AQT will give you a warning message. You then have the option of aborting the join (in case you have made a mistake).

Multi-column joins

If your join is a multi-column join, you will need to repeat the join procedure for every column in the join. As you do so, you will get the message “This relationship has been added to the existing join”.

You get only one join-line between the tables, even though there are multiple columns in the join. This is in contrast with some other products, which show one join-line for every pair of columns in the join.

Tables relating to themselves

You cannot join a table to itself.

If a table has a relationship with itself (which may well be valid), you will need to add the table twice to the query and join these. Even though these two tables have the same name, they will have different table-id/correlation names, so they can be referred to without ambiguity.

Multiple relationships between two tables

Similarly, there can only be one relationship between two tables. If TableA has two relationships to TableB (again, this is quite normal) you must create two instances of TableB in the query and join TableA to each of these.

Viewing or Amending Join Information

If you click on a join-line, the columns which are in the join will be highlighted. This is a very quick way to see the definition of join.

For other join options, right-click the join. You will shown a pop-up menu with options:

Removing a table from the query

You can do this by clicking on the Close (X) button on the table.

Selecting query columns

You can specify whether a column is in the query by checking / unchecking the column.

Click All and None to quickly select that All or None of the table columns are in the query.

To specify other options about the columns, go to the Columns tab.