Design conditions for ORDER BY clauses

An ORDER BY clause is used to sort resulting data in ascending or descending order. You can create the ORDER BY clause in the SELECT query based on columns or expressions using the Order By tab of Tabbed Editor. The clause structure is organized into three boxes: Columns, Ordered By, and Expression.

Open Tabbed Editor

To open Tabbed Editor, do one of the following:

  • In the top menu, select Query > Show Tabbed Editor.

  • On the Query toolbar, click Show Tabbed Editor.

Create an ORDER BY clause

1. In the Columns box, select the columns to sort by, then click Add the column. The columns appear in the Ordered By box.

2. Optional: To reorder multiple columns, in the Ordered By box, use Move up and Move down icon.

Tip

Data is sorted in descending order by default.

To sort in ascending order, click Sort Ascending.

To remove a column, select it, then click Remove the column.

3. In the Expression box, specify the expression to sort the data, then click Add expression.

The expression appears in the Ordered By box.

Add the expression to the ORDER BY clause

4. Optional: To preview the query, click Text in the bottom panel of the Query Builder document.