Berserk Docs
Tabular OperatorsFilter Operators

take

Returns up to the specified number of rows from the input table.

Returns up to the specified number of rows from the input table. There is no guarantee which rows are returned unless the input is sorted.

Syntax

take count

Limit output to N rows

Parameters

NameDescription
countMaximum number of rows to return

Examples

Example 1

datatable(warrior:string, weapon:string)[
  "Ragnar", "axe",
  "Bjorn", "sword",
  "Lagertha", "spear",
  "Ivar", "bow",
  "Floki", "hammer"
]
| take 3
warrior (string)weapon (string)
Bjornsword
Lagerthaspear
Ragnaraxe

Example 2

datatable(ship:string, crew:long)[
  "Naglfar", 80,
  "Wave Rider", 45,
  "Storm Bear", 60
]
| sort by crew desc
| take 2
ship (string)crew (long)
Naglfar80
Storm Bear60

On this page