limit

Constrain the number of rows returned and then cancels the query.

Syntax

limit [OFFSET] MAX
Required Parameters
MAX
Maximum number of records from the query results. The query is canceled when the specified number of query inputs is reached. Note that some commands may not work as intended if the query is canceled.
Optional Parameters
OFFSET
Number of query results to skip (default: 0).

Usage

  1. Return the first 5 rows and then cancel the query.

    table sys_cpu_logs | limit 5
    

    The query command above has the same results as the following:

    table limit=5 sys_cpu_logs
    
  2. Ignore the first row and return the following 2 rows and then cancel the query.

    table sys_cpu_logs | limit 1 2
    

    The query command above has the same results as the following:

    table offset=1 limit=2 sys_cpu_logs