Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: How To (Forms, Reports, and more) > Queries/Views > Query Builder > Using the Query Builder

GROUP BY Clause

Scroll Prev Top Next More

The "GROUP BY Clause" option is used to group duplicate columns in a view. With the addition of a GROUP BY on several columns, a function (SUM,COUNT, etc.) can be added to another column to display a calculation of the results. To add a GROUP BY to your view, the following methods are available:

 

select the "GROUP BY Clause" button on the Query Builder Toolbar

select "Query" > "GROUP BY Clause" from the menu bar

right click on the desired table/view displayed in the list of Tables in Use

 

QBE_GROUPBY

 

 

Once the GROUP BY dialog appears, you can select the table from the list of selected tables in the Table drop-down list. After you pick the desired table, select a column from the associated list, choose whether the sort order is "Ascending" or "Descending", and press the Add button. Repeat this for all columns you wish to have grouped in the query.

After selecting the columns and their desired sort order, you can rearrange them by selecting a column in the "Current Selection" list, and using the "Move Up" or "Move Down" button respectively. You can also remove an unwanted sort on a column by selecting the column from the "Current Selection" list, and pressing the "Remove" button. If you wish to change the sort order for a selected column, right click on the column to display the speed menu for changing the order.

 

The "HAVING Clause" panel can be used to determine which rows of data to include, based on the results of the GROUP BY clause.