BY.EXP, BY-EXP

Top  Previous  Next

 

The BY.EXP sort clause keyword applied to a multi-valued field causes the query processor to explode the multi-valued items to form separate single valued records and to sort these into ascending order prior to display or when building a select list.

 

 

Format

 

BY.EXP field

 

where

 

fieldis the field name or evaluated expression to be used to determine the sort order.

 

 

The BY.EXP keyword causes records to be sorted into ascending order of the values stored in the specified field. The comparison is performed before conversion of the data to its display format. If the display format is left justified, a left justified sort is performed. Conversely, if the display format is right justified, a right justified sort is performed.

 

If more than one sort clause is present, sort criteria are applied in the order in which they are specified.

 

 

Example

 

The command

 

LIST ORDERS PART.NO QTY LINE.TOTAL

 

might produce a display such as that below.

 

LIST ORDERS PART.NO QTY PRICE LINE.TOTAL

ORDER   PART   QTY   PRICE   TOTAL.

24842    648     7   10.00    70.00

        216     3    8.00    24.00

24851    107     2   12.50    25.00

24856    319     6    4.50    27.00

        372     1   18.75    18.75

3 records listed.

 

The command

 

LIST ORDERS PART.NO QTY LINE.TOTAL BY.EXP PART.NO

 

applied to the same data would produce the display below.

 

LIST ORDERS PART.NO QTY PRICE LINE.TOTAL

ORDER   PART   QTY   PRICE   TOTAL.

24851    107     2   12.50    25.00

24842    216     3    8.00    24.00

24856    319     6    4.50    27.00

24856    372     1   18.75    18.75

24842    648     7   10.00    70.00

3 records, 5 values listed.

 

 

See also:

BY, BY.DSND, BY.EXP.DSND