Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Order by allows you to sort your search results based on an indexed field - you can sort by clicking the search header in the grid to sort by a single column, but if you wish to sort by more than one column you need to use TQL.

Syntax

ORDER BY has a syntax that is similar to SQL and JQL query languages:

Code Block
languagenone
<Expression> ORDER BY <FieldName> [ ASC | DESC ] , <FieldName2> [ ASC | DESC ] ...

Examples

Order by Last Updated At (descending order, newest first) and the name Ascending (A to Z):

Code Block
languagenone
ORDER BY LastUpdatedAt DESC, Name ASC

Order entities in the same order as they appear within the "Explorer" tree:

Code Block
languagenone
ORDER BY OrderNumber ASC