Sorting the data
To sort the data you are viewing or editing in TABL display format, use the SORT primary command.
You can specify up to 5 column numbers (the most significant first) and whether you want the data sorted in ascending (the default sequence) or descending sequence for each column number you specify.
Examples
SORT #7 D #6 #3
- Sorts all rows on the column with column number #7 (primary sort key) in descending order, then on the column with column number #6 (secondary sort key) in ascending order, then on the column with column number #3 (minor sort key) in ascending order,
SORT #6 X
- Sorts all excluded rows on the column with column number #6 in ascending order (as if non-excluded rows did not exist).
Note: The SORT command only changes the order in which you view the
data; it has no effect on the order in which the data is stored within Db2®.
Related references