613-518-1166 info@zimdatabases.com

ZIM Language Reference

SORT

< All Topics

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

SORTED BY

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents