Skip to content

Grouping Panel

The Grouping panel provides tools to calculate statistics based on a table of a custom SQL query. It uses GROUP BY queries to extract unique values for COUNT (default), SUM, AVG, MIN, MAX, and other analytics functions, displaying the results in dedicated columns.

Info

To open the Grouping panel click Panels -> Grouping panel on the Right sidebar or use shortcut.

How to use the Grouping panel

To obtain the grouping results for one or more columns of a data table, open the Grouping panel, then, in the results table, put the cursor onto the data type icon of the table header, and drag-n-drop the column(s) into the panel:

If you add several columns to the panel, DBeaver groups data in the order the columns go and calculates statistics based on the grouping.

Viewing the query

If you want to see the entire query, click on the Query button located in the top-left corner of the Grouping panel to open it.

Function management in the Grouping panel

Adding a function

By default, the COUNT function is used. You can add other functions as well.

To add a function, follow these steps:

  1. Click the Edit grouping columns button on the panel's toolbar. Alternatively, right-click the Grouping panel window and navigate to the Edit grouping columns option.

  2. In the Grouping Configuration window, locate the Functions area. Click Add and type the function into the new row.

    • DBeaver provides auto-complete options for your convenience.
    • Indicate the column name in brackets. Note that COUNT is the only function that allows using * instead of specifying a column name.
  3. To complete the process, click OK.

Removing a function

To remove a function, in the same Grouping Configuration window, select the function and click Remove, then click OK. To remove all functions, click Clear and then OK.

Column management in the Grouping panel

Adding a column

You can also manage columns in the same Grouping Configuration window.

To add a column:

  1. Click the Edit grouping columns button on the panel's toolbar.

  2. In the Grouping Configuration window, go to the Columns area. Click Add and type the column name into the new row.

    • DBeaver provides auto-complete options for your convenience.
  3. To complete the process, click OK.

Tip

You can add a column with an expression for MySQL/MariaDB databases. The expression will be calculated in the resulting column:

Removing a column

  • To remove a column, in the same Grouping Configuration window, select the column and click Remove, then click OK. To remove all columns, click Clear and then OK.

  • Alternatively, you can remove a column by clicking the column name and then clicking the Remove grouping column button in the panel's toolbar.

To clear all results from the Grouping panel, click the Clear grouping button .

Additional settings

Default sorting

Click the Default Sorting button to access sorting options for the grouped data. The dropdown menu provides the following sorting criteria:

Option Description
Unsorted Leaves the data in its original order.
Ascending Sorts the grouped data in ascending order.
Descending Sorts the grouped data in descending order.

Select the desired option to apply the corresponding sorting criteria to the grouped data.

Show duplicates only

Click the Show duplicates only (COUNT > 1) button to filter the results and display only those rows where the COUNT is greater than 1.