Sort and group data in the grid

When you right-click a table or multiple selected tables in Database Explorer and select Select All Rows, the data is returned unsorted by default. If you run a custom SELECT query, the data is sorted only if the query includes a sorting clause, such as ORDER BY.

dbForge Studio for SQL Server lets you sort and group data directly in Data Editor.

Sort data in the grid

To sort data in the grid, use one of the following ways:

  • Select the column header.
  • Right-click a column header and select Sort Ascending or Sort Descending.

The sort glyph appears on the column header, indicating that this column is sorted in Ascending sort glyph ascending or Descending sort glyph descending order.

To assign a secondary sorting, hold down Shift and select another column header.

You can set as many sorting columns as you need.

Remove sorting

To remove sorting from a specific column, hold down Ctrl and select the column.

To remove sorting from the selected column, right-click the column header and select Clear Sorting.

If the column is not sorted, the sort glyph is hidden.

Click the sort glyph to remove sorting from the column

Group data

To group data by column, use one of the following ways:

  • Right-click the column header you want to group data by and select Group By This Column.

    The data is displayed in groups marked with collapsed nodes. The column header is moved to the Group by Box pane.

  • On the Data Editor toolbar, click Data Editor toolbar - Group by Box, then drag the column header you want to group data by to the Group by Box pane.

To group data by multiple columns:

  • Drag them to the Group by Box pane.
  • The grid displays a tree of nested groups.

Grouping data by column

Expand or collapse groups

To expand the groups, click the Expanded group icon expanded group icon.

To collapse the groups, click the Collapsed group icon collapsed group icon.

Grouping by multiple columns

To expand or collapse all groups, right-click the Group by Box pane and select Full Expand or Full Collapse.

To sort grouped data, use one of the following ways:

  • Click the column header.
  • Right-click the column header and select Sort Ascending or Sort Descending.

Cancel grouping

To cancel grouping by column, use one of the following ways:

  • Drag the column header from the Group by Box pane to the grid.
  • Right-click the column header and select Ungroup.

Remove all groupings

To remove all groupings, right-click the Group by Box pane and select Clear Grouping.

Note

Data sorting and filtering can be performed either on the client or the server side.

Remove the Group by Box pane

To remove the Group by Box pane, right-click it and select Hide Group By Box.