Navigation
Features
Manual
What's new
FAQ
Imprint

FAQ

Contents     Index    << Previous    Next >>    PDF

Query Builder

Menu: View / Query Builder


Switches the view to a visual builder of SQL queries.


The main window can be divided into the following parts:

·The Query Building Area is the main area where the visual representation of query will be displayed. This area allows you to define source database objects and derived tables, define links between them and configure properties of tables and links.  
·The Columns Pane is located below the query building area. It is used to perform all necessary operations with query output columns and expressions. Here you can define field aliases, sorting and grouping, and define criteria.  
·The Query Tree Pane is located at the left. Here you may browse your query and quickly locate any part of it.  
·The page control above the query building area will allow you to switch between the main query and sub-queries.  
·The small area in the corner of the query building area with the "Q" letter is the union sub-query handling control. Here you may add new union sub-queries and perform all necessary operations with them.  

To add a table to the query please drag&drop it from the navigator.

To remove an object from the query, select it and press the Del key or simply click the Close button in the object header.

You may change the properties of each object added to the query by right clicking the object and selecting the Edit... item from the drop-down menu or simply by double-clicking the object header.

To create a link between two objects (i.e. join them) you should select the field by which you want to link the object with another and drag it to the corresponding field of the other object. After you finish dragging, a line connecting the linked fields will appear.

The join type created by default is INNER JOIN, i.e. only matching records of both tables will be included in the resulting dataset. To define other types of joins you should right click the link and select the Edit... item in the drop down menu or simply double-click it to open the Link Properties dialog. This dialog allows you to define join type and other link properties.

To remove a link between objects, right-click the link line and select the Remove item in the drop-down menu.

The easiest way to add a field to the list of query output fields is to check the checkbox at the left of the field name in the Query Building Area. To include all the fields of the object you should click the checkbox at the left of the asterisk item of the object.

Another way is to select a field name from the drop-down list of the Expression column in the Columns Pane. And the most common way is to write any valid expression in the Expression column in the Columns Pane.

To remove a field from the list of query output fields you should uncheck the checkbox at the left of the field name in the Query Building Area or you may remove it by unchecking the Output column checkbox.

Such operations as removing lines from the Columns Pane or re-ordering output fields are available by right clicking on the leftmost gray column via the drop-down menu.

The output field's aliases may be defined in the Alias column of the Columns Pane.

To enable sorting of output query fields you should use the Sort Type and Sort Order columns of the Columns Pane. The Sort Type column allows you to specify the way the fields will be sorted - in the Ascending or Descending order. The Sort Order column allows you to setup the order in which fields will be sorted, if more than one field will be sorted. To disable sorting by some field you should clear the Sort Type column for this field.


It's also possible to create or edit a SQL query directly. This will overtake all changes into the visual query builder.