Grouping rows and specifying search conditions for groups

Use the Groups page to specify which columns to use for grouping results. When you group results, the data in the result set is divided into groups by the values in the specified columns. One row of data is returned for each group.

You can group more than one column. However, the groups will not be sorted; use the Order page to sort the result set.

../rule.gif

To include groups in your result set:

  1. Select the Include grouping columns checkbox. The columns that are specified in the Selected columns list on the Columns page are displayed in the Grouping columns list. These are mandatory grouping columns.

    If this checkbox is selected and no columns are specified in the Selected columns list on the Columns page, then all of the available columns are displayed in the Grouping columns list.

  2. To add more columns to the Grouping columns list:

    1. Select one or more columns in the Available columns list. The list displays all of the columns in a particular table. You can expand or collapse a table to display or hide the columns that are included in that table.

    2. Click > to add the columns to the Grouping columns list. Click >> to add all of the columns from all of the tables in the Available columns list to the Grouping columns list.

  3. To remove one or more columns from the Selected columns list, click on the columns, then click <. To remove all of the columns from the Selected columns list, click <<.

    To remove mandatory grouping columns from the Selected columns list on the Groups page, you must first remove those columns from the Selected columns list on the Columns page.

Filtering grouping results

You can eliminate unwanted grouped data by filtering the results that are returned by the grouping columns. To do this, either type the conditions in the Group conditions field, or click Advanced Expression to build one or more conditions.

../rule.gif

Related information

Groups page - Fields and controls

Changing the format of date and time data

Specifying the tables for an SQL statement

Specifying result columns

Joining tables

Specifying search conditions for rows

Building expressions

Sorting the result set

Verifying the SQL statement

Inserting column values

Updating column values

Completing your SQL statement

Remapping data to another SQL data type

Creating SQL statements with SQL Assist

Logging on to SQL Assist

Selecting the type of SQL statement to create