IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Sort

Last modified: 21 June 2023

To sort the column data, click the column name. By default, a new ORDER BY query is sent to the database each time you click a column name. You can also sort the data on the client side only. To do that, click the Show Options Menu button (the settings icon) and deselect the Sort via ORDER BY option.

The column sorting is not stacked by default. It means that if you click a column name to sort data by, the sorting based on other columns will be cleared. If you prefer to use the stacked sorting, click a column name while pressing Alt.

https://resources.jetbrains.com/help/img/idea/2023.1/db_stacked_sorting.png
Gif

To change the default option for stacked sorting, open settings by pressing CtrlAlt0S and navigate to Tools | Database | Data Editor and Viewer | Data Sorting. Change the value for the Add columns to sorting option.

Also, you can use the ORDER BY filter and sort data in a table by writing a query in the ORDER BY field.