Using the Query Diagram view
The
Query Diagram view provides graphical support for composing SQL queries.
Use the Query Diagram view to create new queries if you are familiar with
SQL languages, or to edit an existing query. The SQL Query Diagram
views are different; each is described below.
To edit an existing query, double-click it on the Worlds page
of the World Manager.
Creating or modifying SQL queries
The Query Diagram view for SQL contains a split screen
with two diagram windows:
- Query diagram. Allows you to copy tables
from your workbook into the diagram space and to create joins by
dragging a link from one or more columns in one table to those in
another table.
- Grid tool. Contains list boxes from which
you can select return columns from the query, create aliases for
the columns and calculated values, and select a sort order for the
data returned.
You can use the Query Diagram view to perform the following tasks
for SQL queries:
- Insert a new table (click Insert --> Table).
- Remove a table (right-click the table and click Remove Table).
- Create a join between two tables (drag a column from one table
onto a column in another table).
- Edit the join operator (double-click the join line).
- Remove a join (click a join line and press Delete).
- Add or edit a parameter
(right-click the Parameters block and click Define Parameter).
- Remove a parameter (right-click the Parameters block and click Delete Parameter).
- Include a column (right-click the column and click Include Field).
- Create display names for table columns (type names in Display
Name fields).
- Create a filter (type the criteria in the Row Filter row or
use the Formula bar). For more information see, Modifying properties using the Formula bar.
- Create or modify a key sequence (click a field in the Key Sequence
row and select from the list).
- Assign or remove sort order (click in a field in the Sort Order
row and select from the list).
- Assign an aggregate function to a table column (click a field
in the Aggregate row and select from the list).
The following figure shows the Query Diagram displaying
an SQL query.