Relation:limit

Limit selects some rows based on the order in the relation.

Description

limit start (count)

Parameters

  • start: number
  • count: number

Examples

Using the sample relation films.csv

read "films.csv"
order film
limit 1 3

film director year
A bout de souffle Godard 1960
Cléo de 5 à 7 Varda 1962
Der starke Ferdinand Kluge 1976

read "films.csv"
order film
limit -5

film director year
Jules et Jim Truffaut 1962
Pierrot le fou Godard 1965
Sans toi ni loi Varda 1985
Tirez sur le pianiste Truffaut 1960
Week-End Godard 1967

read "films.csv"
project inline director, year min
select year = year_min

film director year
A bout de souffle Godard 1960
Tirez sur le pianiste Truffaut 1960
Cléo de 5 à 7 Varda 1962
Die verlorene Ehre der Katharina Blum von Trotta 1975
Der starke Ferdinand Kluge 1976

Comments

Limit is not really a relational operator, but useful for output. Order first, because the other operators do not result in a defined order.

Limit modifies the current relation.

You can only limit globally, if you want to limit by a group, you must combine as in the example above.

You can also work with the constant Relation:rownumber.

See also

Relation:order