The sort command sorts resultset in ascending or descending order by one or more key columns. Key columns can be defined either by name, alias or expression. Multiple sorting keys must be separated by commas and the sorting priority goes from left to right.

| sort( {field_name | '@'position | alias | expression } [ASC | DESC] [ ,... ] )

Use ASC (ascending) or DESC (descending) to specify the sort direction. ASC is the default. Each sort key can have its own direction assigned.


dual(5) | select(i, s, ip) | sort(i DESC);