Query offers you two types of sorting - simple and custom. The guidelines on how to apply both types of sorting are described in the following articles:
Both types of sorting can be applied only in the calculation area. It is impossible to sort data entered manually.
The number of sorts is also limited by the number of variables in your query. Every variable can have only one sort assigned, but it can be composed of many levels.
Managing sorts
It is possible to browse existing sorts by clicking on the Sort button (1). The list of existing sorts allows you to edit (read more in Custom Sort) or remove a sort. From this menu, you can also create a new Custom sort by clicking on "Create new sort rule."