#

# LogiView

## Command 'order_by'

| This command is used to specify the order for sorting the matching data of a catenated Select instruction ('select', 'where', 'order_by', 'exec_select'). Any number of sorting criteria is possible.
| This command must not be called with a conditional instruction.
| ### Syntax:
| order_by({ORD_LIST})
| ### I/O parameters:
| {ORD_LIST} | String expression with the name of a table field in the format "column name" or "table name.column name" followed by a '+' or '-' symbol. This symbol defines if the selected records are sorted in ascending or descending order of the prefixed table field.
| - |
| ### Return value:
| - |
| ### Example:
| Declaration of Variables
    10 select(EP_DOC_CID)
    20 where("T_DOC_DAT.DOCUMENT_ID"="EP-00050"))
    30 order_by ("T_DOC_DAT.DOC_VERSION"+,"T_DOC_DAT.DOC_REVISION"-)
    40 RES = exec_select()
| Result:
| First, the selected records are sorted in ascending order of the table field "T_DOC_DAT.DOC_VERSION" and then in descending order of the table field "T_DOC_DAT.DOC_REVISION".
| Functions and commands: DB/Mask Interface