Skip to content

MAXROWS

In v20.3+, use the MAXROWS clause to retrieve a maximum of N results, applied after any filters.

SELECT {fields}
FROM {query target}
MAXROWS {number}

The following are examples of queries using MAXROWS.

Query: Retrieve a Maximum of N Documents

Section link for Query: Retrieve a Maximum of N Documents

The following query returns a maximum of 500 documents:

SELECT id
FROM documents
MAXROWS 500

When used with the PAGESIZE clause, the MAXROWS clause must come first. The following query returns a maximum total of three (3) documents with one (1) result per page:

SELECT username__sys
FROM user__sys
MAXROWS 3
PAGESIZE 1