Query Builder

In the Query Builder dialog, you use a graphical environment to add tables and views to the query, and you select which columns to include. All you need to do is drag and drop.

To open the query builder, first switch to the Query Tools tab. Then click on Add Query. In the Query Editor window, click Run Query Builder…

To add a table or view, double-click it or drag-and-drop it from the Tables pane onto the Diagram pane.

Then, select the required columns.

To add another table, drag it from the Tables pane to the Diagram pane. This invokes the Join Editor dialog.

First, check the join type. You can specify it in the Join type combo box. An Inner join and Left outer join are supported.

To edit column and table names in the existing condition, click the name you wish to replace and choose a different name from the popup menu.

You can add new conditions and remove existing conditions using the + and x buttons, respectively.

After you have added the tables and selected the required columns, you can change settings for each column in the Grid pane.

The Column and Table settings show you the source of the data for the query output.

The Alias setting allows you to provide a “friendly” name for the output in place of the original column name.

Note: Aggregated columns should always have an alias.

The Output column allows you to choose whether to include specific columns to the query.

Use the Sorting type combo box to specify the sort order of column values. The Sort order column allows you to specify the order in which several columns are sorted.

The Group By statement is used in conjunction with the aggregate functions to group the result-set by one or more columns.

The Aggregate option allows you to specify the aggregate function used to aggregate column values.

Note: You should apply aggregation or grouping to all the columns or to none of them.

 

To filter data in the Query Builder, click the Filter... button near the bottom left corner of the query builder window. This will invoke the Filter Editor dialog, which allows you to build filter criteria. Refer to the next section for details on how to filter a query.