SORT
Welcome to our Knowledge Base
Documentation | Blog | Demos | Support
< All Topics
Print
SORT
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
Sorts the members of an existing result set.
Syntax
SORT [setname>] BY expression [ASCENDING|DESCENDING]
Parameters
setname | The name of a result set. If setname is not specified, the current set is used. |
expression | An expression that identifies a field to be used as a sort key. Complex expressions must be enclosed in parentheses. |
ASCENDING or DESCENDING | Specifies how the sort on the associated key is to be performed. ASCENDING (default) Sorts in “alphabetical order” (A-Z, 0-9). DESCENDING Sorts in “reverse alphabetical order” (Z-A, 9-0). |
Example
find all Employees where Name = Smith -> SmithNames
sort SmithNames by Salary
The preceding two commands could be combined into one by using a SORTED BY subcommand.
sort SmithNames by FirstName DeptNum Salary descending
The preceding command sorts the employees named Smith by first name (ascending order), department (ascending order), and salary (descending order).
See Also
Updated
ByJason Lee
Was this article helpful?
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
5