guides:programming:programmers_reference_manual:sorting_by_more_than_one_column

Sorting by More Than One Column

Multiple By clauses can be specified in an OpenList command. If so, the leftmost By clause becomes the primary sort column. The second By clause is used to sort data within the groups created by the primary sort column, etc. For example, the command:

List CUSTOMERS COMPANY CITY ST By ST By CITY

would produce a report that looks like this:

COMPANY      CITY          ST
-----------  -----------   --
BYTES, INC.  GLENDALE      CA
ARROW CORP.  LOS ANGELES   CA
ACME         STAMFORD      CT
XXX CO.      HARTFORD      CT
SMITH CORP.  WATERBURY     CT

In this report, all like states (the primary sort column) are grouped together. Within the state groupings, the rows appear in city order (the secondary sort column).

  • guides/programming/programmers_reference_manual/sorting_by_more_than_one_column.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1