Order by operators
Order by operators allow you to change the order of rows in a data set according to the values in one or more designated columns.

Order by operators provide the same function as an ORDER BY clause in an SQL statement. An order by operator takes an input data set and one or more columns to sort by, and produces a single output data set that is ordered by those column values. When you designate more than one sort column, rows in the data set will be ordered by the first sort column first. Within any group of rows with the same value in the first column the rows will be ordered according to values in the second designated column and so on. For each column that you sort by, you can specify ascending or descending order.
Example
The following example shows how an order by operator would affect the following two-column data set.COL1 COL2 E 5 A 7 D 3 E 2 C 6 F 6 B 4 B 1Sorting the data in ascending order by COL1 and COL2 results in the following output data set:
COL1 COL2 A 7 B 1 B 4 C 6 D 3 E 2 E 5 F 6