| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | [discrete][[esql-sort]]=== `SORT`**Syntax**[source,esql]----SORT column1 [ASC/DESC][NULLS FIRST/NULLS LAST][, ..., columnN [ASC/DESC][NULLS FIRST/NULLS LAST]]----*Parameters*`columnX`::The column to sort on.*Description*The `SORT` processing command sorts a table on one or more columns.The default sort order is ascending. Use `ASC` or `DESC` to specify an explicitsort order.Two rows with the same sort key are considered equal. You can provide additionalsort expressions to act as tie breakers.Sorting on multivalued columns uses the lowest value when sorting ascending andthe highest value when sorting descending.By default, `null` values are treated as being larger than any other value. Withan ascending sort order, `null` values are sorted last, and with a descendingsort order, `null` values are sorted first. You can change that by providing`NULLS FIRST` or `NULLS LAST`.*Examples*[source,esql]----include::{esql-specs}/docs.csv-spec[tag=sort]----Explicitly sorting in ascending order with `ASC`:[source,esql]----include::{esql-specs}/docs.csv-spec[tag=sortDesc]----Providing additional sort expressions to act as tie breakers:[source,esql]----include::{esql-specs}/docs.csv-spec[tag=sortTie]----Sorting `null` values first using `NULLS FIRST`:[source,esql]----include::{esql-specs}/docs.csv-spec[tag=sortNullsFirst]----
 |