limitΒΆ

The limit command limits the rows in its input dataset by number of rows expressed by rowcount or computed by expression. You can also specify offset representing the number of rows from beginning to be omitted.

limit( [offset,] { rowcount | expression } )

Example. Output top five of highest integer values in the field i, sorted in descending order:

1
dual(10) | select(i, ip, s) | sort(i DESC)  | limit(5);
i ip s
9 0.0.0.9 9ho9
8 0.0.0.8 8ho8
7 0.0.0.7 7ho7
6 0.0.0.6 6ho6
5 0.0.0.5 5ho5