datagrip

Sort Result Set in Data View by Multiple Columns


In prior versions of DataGrip (presumed earlier than 2021.1), result sets within the Data View pane allowed ad-hoc sorting across multiple columns by clicking on column headers in sequence to assign a custom sort order. This functionality is documented in the Data Editor Documentation. Since the release of version 2021.1, clicking multiple columns in sequence resorts the entire result set by the most recently clicked column header only.

Using the following statement as an example yields a result set with 120 date values spanning 4 months, where month_start_date is repeated for calendar_date values that occur within the same month:

SELECT month_start_date
     , calendar_date
FROM calendar
WHERE month_start_date BETWEEN '2021-01-01' AND '2021-04-01'
GROUP BY 1, 2

When the month_start_date column header is clicked, the entire result set is sorted based on month_start_date:

data_view_sorted_by_col_1

When the calendar_date header is subsequently clicked (following clicking the month_start_date column header), the entire result set is re-sorted based only on the values of calendar_date:

data_view_sorted_by_col_2

Is there a way to sort by multiple columns in version 2021.1, or has this functionality been intentionally removed?


Solution

  • As described in release notes, from 2021.1 accumulating sorting should be performed via Alt/Opt+Click.