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).