Online Documentation for SQL Manager for DB2

Setting output fields


The Selection tab displays the output fields of the query as a grid.

 

The grid allows you to edit the names of the query output fields, specify their display order and set the aggregate functions for each field. To remove a field from the list, right-click the field row and select the Delete current row popup menu item.

 

Visual Query Builder - Selection field menu

 

The popup menu also allows you to insert a nested query and add a CASE clause. To edit the CASE clause, use the CASE END AS dialog.

 

Query Builder - Setting output fields - CASE

 

 

To change the input query field, click it and then type the field name or select it from the drop-down list.
To change the output query field name, set the cursor at the corresponding column and type the required field name.

 

To reorder fields in the list, use the iconTools_QB_MoveFieldUp iconTools_QB_MoveFieldDown buttons.

 

Query Builder - Setting output fields

 

 

To set an aggregate function for a field, click the field row within the Aggregate column, and then type in the function name or select one from the drop-down list (SUM, MIN, MAX, AVG, or COUNT).

 

The Grouping column displays the grouping state for each of the output fields.
 

CheckBox2 Select only unique records
If you check this option, the duplicate records (if any) are not included into the query result (i.e. the DISTINCT keyword is added to the SQL query text).