Relation:order

Orders the rows on the current relation.

Description

order name option (, name option...)

Parameters

  • name: must be a valid name.
  • option:
    • 1 numerical ascendant.
    • 9 numerical descendent.
    • a alphabetically ascendant case insensitive (b=B). This is default.
    • z numerical descendent case insensitive.
    • A alphabetically ascendant case sensitive (b>B).
    • Z numerical descendent case sensitive.

Examples

Using the sample relation films.csv

read "films.csv"
order director a, annee 1

film director year
A bout de souffle Godard 1960
Pierrot le fou Godard 1965
Week-End Godard 1967
Der starke Ferdinand Kluge 1976
Tirez sur le pianiste Truffaut 1960
Jules et Jim Truffaut 1962
Cléo de 5 à 7 Varda 1962
Sans toi ni loi Varda 1985
Die verlorene Ehre der Katharina Blum von Trotta 1975

read "films.csv"
order director a, title 1

film director year
A bout de souffle Godard 1960
Pierrot le fou Godard 1965
Week-End Godard 1967
Der starke Ferdinand Kluge 1976
Tirez sur le pianiste Truffaut 1960
Jules et Jim Truffaut 1962
Cléo de 5 à 7 Varda 1962
Sans toi ni loi Varda 1985
Die verlorene Ehre der Katharina Blum von Trotta 1975

Comments

Order is not really a relational operator, but useful for output. Use it just before print or write.

See also

limit